3
$\begingroup$

I've inherited some FPGA code implementing an interpolation by 2 with a FIR low pass filter. The code came with a cocotb test bench that also models a filter (scipy.signal.lfilter) and then compares the VHDL implementation against the model. The VHDL and the model agree. I've used some captured ADC data of a baseband 20MHz WIFI signal and passed that through the cocotb test and the output spectrum is not quite as I expected.

On the left is the time-domain data and on the right the FFT of that time-domain data. The top plots are the input test data (my 20MHz baseband WIFI data). The middle plots are the output of the VHDL Interpolation x2 FIR and the bottom plots are the Python model output.

enter image description here

So I get the doubling of the time-domain data and spectrum as expected but i'm not sure why I get the roll-off of the noise floor in both the VHDL and model output. Can anyone offer any advice as to what might be causing that sort of feature?

Adding the frequency response of the filter for the given taps: FIR Frequency response

$\endgroup$
2
  • $\begingroup$ Hi and welcome to DSP.EX, did you take a look on the frequency characteristics of the filter you are using? $\endgroup$ Mar 18, 2022 at 10:02
  • $\begingroup$ Hi. i've added the frequency response of the FIR based on the calculated taps. $\endgroup$
    – Adi
    Mar 18, 2022 at 10:14

3 Answers 3

7
$\begingroup$

Everything is operating just as it should and this looks like a fine interpolation. The spectral noise floor in the proximity of the signal is not changing (there is no noise summing there -it is the identical noise spectrum), and the 60 dB of rejection in the low pass filter is properly rejecting the image to below prior noise levels. What you are seeing at the edges of the interpolated spectrum specifically is the quantization noise which is limited by the width datapath of the output, while the floor close in is likely due to the width of the datapath at the input.

Interpolation

Regardless of the amount of filtering provided, the fixed point output will have a quantization noise floor as given by the number of bits provided and is well represented as a white noise (the power due to quantization noise is spread evenly across the bandwidth). This is exactly what we see at the filter output in its rejection band, and the small signs of some peaks at the very edges is the residual of the images after the 60 dB of filter rejection. (Given these images are below the original noise floor, the filter rejection is sufficient).

The interpolator could be improved (achieve the required performance with less resources) if the passband is not expected to be larger by concentrating the rejection of the low pass filter to be just at the image locations and only pass the desired passband with minimum distortion. This would increase the transition band of the filter which means more rejection where needed (or the same rejection) with less coefficients. There is no good reason to have a lower quantization noise floor at the edges of the spectrum (there are more bits in the output datapath than needed). The noise density of the floor would continue at the same level in this case. (This is a great application for multiband filters which the least squares algorithm for filter design in Matlab, Octave and Python scipy.signal all as 'firls' readily provide, when doing higher interpolation ratios where there are multiple images to reject).

improved interpolation

$\endgroup$
2
  • $\begingroup$ Thanks for taking the time for that detailed response. Yes the filter passband is larger than I need for this 20MHz use case but my design will have to cope with 40, 80 and 160MHz WIFI channels eventually. $\endgroup$
    – Adi
    Mar 18, 2022 at 13:38
  • $\begingroup$ @Adi Understood. Looks like a fine design then. $\endgroup$ Mar 18, 2022 at 14:09
3
$\begingroup$

i'm not sure why I get the roll-off of the noise floor

That's expected behavior: the original bandwidth of your input signal was 175MHz (or thereabouts). After interpolation the bandwidth should be the same, i.e. you would expect everything above $175MHz to be 0 (or as low as the low-pass filter can get it).

What you call "noise" is actual "signal" for the interpolator. It will interpolate both your baseband signal and your original noise floor. Since your original noise floor is bandlimited, the interpolated noise floor will be bandlimited at the same frequency too.

Given, this argument you would expect the noise floor to be down by about 60 dB above 175 MHz. That doesn't seem to be the case here, so the interpolator is maybe not as good as it should be.

$\endgroup$
1
  • $\begingroup$ Thanks @hilmar, i'll have a look at why the noise floor isn't as low as expected. $\endgroup$
    – Adi
    Mar 18, 2022 at 14:10
1
$\begingroup$

The noise floor in the original signal is actually two noises added up: the noise of the orginal data and the "algorithm noise" caused mainly by the shortness of the signal. (Think of the signal as infinitly long data stream multiplied by a $\text{rect}$ function.) This is a convolution with an $\text{si}$ function in the frequency domain. By interpolating the time data you broaden the spectrum. But outside the original bandwidth, there is no signal noise present so that you just see the "algorithmic" noise.

$\endgroup$
7
  • 2
    $\begingroup$ I don't think this is correct @Max- that floor you see is not the result of convolution. In fact it is the identical spectrum and there is no spreading of the frequency spectrum in the interpolation operation (the convolution with the filter is in the time domain, not the frequency domain). Zero stuffing as is done in the interpolation process duplicates the spectrum at the higher frequency with no change whatsoever to the original spectrum at the original frequency locations. $\endgroup$ Mar 18, 2022 at 12:14
  • 2
    $\begingroup$ Yes but I don't believe it is as you describe with something to do with signal shortness etc. There is quantization noise at the output of the filter (any fixed point filter) that will set the noise floor in the rejection band. The convolution and Si function etc are not any reason for the differences in the floor levels, so as currently written it is confusing (with all due respect :) ). $\endgroup$ Mar 18, 2022 at 12:26
  • 1
    $\begingroup$ @Max It's not clear what you mean by "algorithmic noise due to shortness of signal..." do you mean quantization noise? rounding noise? something related with bit length? $\endgroup$
    – Fat32
    Mar 18, 2022 at 12:29
  • 1
    $\begingroup$ @DanBoschen With your answer, I see that you are correct. I answered before Adi posted the filter response and assumed, that the filter in use would have a much larger rejection band attenuation. $\endgroup$
    – Max
    Mar 18, 2022 at 12:31
  • 1
    $\begingroup$ @Fat32 this was for loss of a better term. I mean the effects caused by the fact that the signal is time constrained causing the spectrum to be infinite. $\endgroup$
    – Max
    Mar 18, 2022 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.