Forums

Need to understand: How noise is folded into BW of interest after LP filtering+decimatiom

Started by niptoz 6 years ago11 replieslatest reply 6 years ago2104 views

Hello out there. I'm pretty new at DSP, but here comes a formulation of my problem

Can anyone explain how i would be able to figure out the SNR after performing low pass filtering and decimation? As i understand the noise of my original signal is folded into the band of interest. What i have done so far is calculated the power in the decimated signal that lies within my bandwidth. I compared it to the power outside this bandwidth, which i see as noise. This gives me a reasonable SNR, but i dont know if it is the correct approach. 

[ - ]
Reply by kazMarch 26, 2017
[ - ]
Reply by niptozMarch 26, 2017

Thank you very much, i will read the article through :) 

-Now i have read it. It doesn't solve my problem. I have already obtained the spectrum of my filtered and decimated signal, where nyquist is moved down. The original signal is a square wave with a BW of interest, amplitude 1.1, and noise of constant amplitude 0.1 on both sides. 

untitled_84502.png

[ - ]
Reply by Rick LyonsMarch 26, 2017

Hi. I suggest that you do not, if possible, use a squarewave as a test signal. Squarewaves are NOT bandlimited so any discrete signal representation of a squarewave will be by necessity imperfect. Perhaps you could use the sum of three or four closely-spaced sinusoids as a test signal. Such a test signal can be very accurately represented by discrete sequences.

[ - ]
Reply by Fred MarshallMarch 26, 2017
.. figure out the SNR after performing low pass filtering and decimation?

Start with the original signal, bandwidth (fs/2), and noise.

When you lowpass filter with the signal of interest within the passband then the noise outside the passband is largely removed and the noise that was inside the passband stays.  So, the SNR changes; generally as the square root of the bandwidth change. 

As i understand the noise of my original signal is folded into the band of interest.

Decimation brings the bandpass components closer together without overlapping them.  And, as you point out, folds the stopband components.  But you probably need to be careful in how you interpret or measure the result.

What i have done so far is calculated the power in the decimated signal that lies within my bandwidth. I compared it to the power outside this bandwidth, which i see as noise.

This neglects the noise inside the passband which has more noise than the stopband.  So, I'd say that this isn't correct. It would be more like this:

Let's say that the lowpass filter has a passband cutoff at fs/4.  So half the noise is "removed" in the stopband from fs/4 to fs/2.  The SNR is effectively improved by sqrt(2) or 3dB and "all" of the noise in this simple treatment is in the passband below fs/4.

When you decimate in time (by 2), you reduce the sample rate to fs/2 and "shrink" the frequency domain elements where the original stopband ranges are folded into the original passband elements.  So, you are effectively adding the stopband noise to the passband noise.  [sqrt(n1^2 + n2^2]  If the stopband noise has been attenuated by 20dB in the lowpass filter then the amount of noise added to the new passband is 20DB below the passband noise.  Thus us probably negligible - so the passband SNR remains "the same" through this simple decimation process.  You want to compare the signal level to the passband noise level.

[ - ]
Reply by niptozMarch 26, 2017

Okay. Thank you for your well formulated reply. It makes sense to me.

[ - ]
Reply by Rick LyonsMarch 26, 2017

Hi. To see how spectral energy folds when CIC decimation filters are used, see Figure 6 at:

http://www.embedded.com/design/configurable-system...

Your method of estimating SNR sounds OK to me.  HOWEVER, that method is only valid if aliased (caused by decimation) spectral energy does NOT fold over and contaminate the spectrum of your lowpass signal of interest (as happens with CIC decimation filters). If your lowpass filter's stopband attenuation is fairly large then very little folding energy should contaminate your signal of interest and your SNR estimates should be valid.



[ - ]
Reply by ahmedshaheinMarch 31, 2017

Hi Niptoz,

I hope that I am not too late to reply to your thread. I believe that you already got your answer from the replies below, I will just try to emphasize certain points, again. BTW, you can find more details in the following blog, it has links to a complete dissertation about decimation filtering and a link for t Matlab toolbox, specific for decimation filter design and optimization. DECIMATION BLOG

Well, regarding the core issue. I will be using/referring to sentences from your question.

“the noise of my original signal is folded into the band of interest”, that is true, bear in mind that this is due sampling and you shall expect even higher noise level in case of using Sigma-Delta Modulator (SDM). This is due to the fact that the SDM is also called a noise shaper in which it shapes the noise in such a way to decrease the noise within the band of interest and increases the noise level outside the band of interest. The noise shaping behavior can be seen in the attached figure. The folded noise due to sampling is located at integer multiples of the sampling frequency. As an example, if the sampling frequency is \(f_s\), then the signal replicas are located at \( 2.f_s, 3.f_s, 4.f_s … \), you can refer to figure 2.6 from the dissertation stated in the blog which I just stated at the top.

I liked very much the phrase used by @Fred_Marshall “shrink”. So, let’s see how this explains the down sampling effect (I am using down-sampling since the following effect is due to down-sampling not decimation, decimation = down-sampling + filtering). What down-sampling is doing, simply shrink/zoom-into the spectrum, in other words (just for simplicity) it is as if you change the sampling frequency from \(f_s\) to \(f_M\) where \(f_M=\frac{f_s}{M}\). Therefore, the replicas would be located at multiples of the new sampling frequency.

Good luck :-)
[ - ]
Reply by Tim WescottMarch 26, 2017

This article may also help: http://wescottdesign.com/articles/Sampling/samplin....

Go down to the section titled "Nyquist and Filters".

I'm not sure if I give an exact formula for calculating what you need, but basically the "fold" happens around \(\frac{F_s}{2}\), and except in really bizarre circumstances, the aliased noise will be uncorrelated to the desired signal, so you can add up all of the energy of the aliased noise that falls in the passband, and add that to any already-existing signal energy.

[ - ]
Reply by niptozMarch 26, 2017

Ugh i guess i still dont get how the noise in my stopband is folded back into the passband. So what i did was looking at the spectrum of both the decimated signal with noise, and without noise. Calculating the respective powers, and substracting those would give the total noise power. Not quite sure about this. 

untitled_34092.png

[ - ]
Reply by Tim WescottMarch 26, 2017

"i guess i still dont get how the noise in my stopband is folded back into the passband"

Read my paper (or anyone's for that matter).  After sampling, a signal at frequency \(f \pm n F_s\) shows up at frequency \(f\).  Because the power spectra of real signals is symmetrical around \(f = 0\), the effect is that the power spectrum of a given signal that's being sampled folds around \(\frac{F_s}{2}\).

I don't have the details of how you're calculating your filtered-and-aliased spectrum from your un-sampled spectrum.  I'm not sure that what you're doing is useful, either -- I find it much more informative to make a plot of the desired sampled signal (usually the one that's not shifted in frequency) vs. any aliased spectra that may be significant.

[ - ]
Reply by niptozMarch 26, 2017

Ok thanks. Well i just designed a FIR filter, and convolved the square signal with the filter coefficients. So what Im trying to do is simply make a solid procedure that calculates the SNR of this square wave, and test it with different filter coefficients.