1

When I record a signal with USRP N320 SDR, it has some problems on the edges of the spectrum. For example, when I choose sample rate 50 Msps, 2 MHz of the start of the spectrum and 2 MHz of the end of the spectrum, gives the wrong results. When it see a pulse on the edges it decreases the power and changes the frequency little bit. But 46 MHz bandwidth is perfectly working.

Sample rate: 50 Msps, Properly working bandwidth: 46 MHz

Sample rate: 100 Msps, Properly working bandwidth: 90 MHz

Sample rate: 200 Msps, Properly working bandwidth: 180 MHz

I tried to filter the edges with bandpass filter but it does give the OOOOOO problem. Even if I choose the sample rate 50 Msps. But normally, I can record successfully without bandpass filter when I choose sample rate 200 Msps.

Is there a solution to record the edges correctly. Or filtering it without dropping samples.

secokit123
  • 41
  • 1
  • 3

1 Answers1

1

First off:

I tried to filter the edges with bandpass filter but it does give the OOOOOO problem

means that your computer isn't fast enough to apply the filter to the data stream. That might mean two things: you've designed a filter that's too long and could be shorter and still do what you want, or what you want to do requires a filter of that length and you will need to find a faster PC (hard) or use a faster filter implementation (did you try the FFT filters?).

For example, when I choose sample rate 50 Msps, 2 MHz of the start of the spectrum and 2 MHz of the end of the spectrum, gives the wrong results.

This is not surprising! Remember that anything with a ADC needs an anti-aliasing filter on the analog side, and these can't be arbitrarily sharp. So, necessarily, the spectrum at the edge of your band gets a bit dampened, and there's a bit of aliasing there. The dampening, you could counteract by throwing an equalizing filter on your PC at it, which would need to necessarily be more compute-intense than what is happening on the USRP, but the aliasing of the lowest frequencies onto the highest, and vice versa, due to finite steepness of the analog anti-aliasing filter you cannot repair. That's the signal processing blues for any kind of acquisition device.

There's one trick though, which the USRP uses: when your requested sampling rate is lower than the ADC's sampling rate, the USRP can internally apply a (better!) digital filter to select that target sampling rate as bandwidth, and decimate to that.

Thus, depending on the ADC rate to output sampling rate relationship (in UHD, the ADC rate is called "master clock rate", MCR), there's further digital filtering and decimation going on in the digital logic inside the N320. These filters also can't be infinitely sharp – and you might see that.

Generally, you'd want that decimation between MCR and the sampling rate you've requested to be an even number, and not too large. Don't have the N320's digital signal processing architecture in my head right now, but I bet using a decimation that's a multiple of 4 or even 8 is a good move – you get to use the nicer half-band filters then.

Modern UHD also has the filter API, with which you can work with these digital filters manually; this rarely is what you really want to do here, though.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • Thanks for the clear explanation. I will try these as soon as possible. And I will post as a reply. So, in UHD Source, my master clock rate is 200 Msps and I want to select sample rate 50 Msps which is decimation of MCR by 4. But I want to access only 45 MHz bandwidth, is it possible by modifiying the UHD source block? – secokit123 Nov 10 '21 at 12:19
  • you could try setting the `master_clock_rate` to 45e6*4 – Marcus Müller Nov 10 '21 at 12:20