# Compute SNR of a signal with not clear fundamental frequency in PSD

I'm trying to compute SNR from a signal in which by visual inspection I can guess the SNR but I cannot compute it because I cannot find the fundamental frequency of the signal as I should be.

On the top you have the original signal and below the signal filtered with a 3rd order bandpass filter with butter configuration from 5 to 40 Hz. Below you have the PSD of both. I cannot really identify the fundamental frequencies of the signal altough there should be a crear one from the peaks on the time domain. Is there any way to get them or any other approach?

• Questions that start with „my question is simple“ almost never are. Yours not an exception to that rule: there's quite a few questions on how to determine an SNR from an observation, but the first step is always explicitly writing down what the S in SNR is; a signal model. I think you're considering a periodic signal of unknown frequency (but with a limited internal from which that frequency might come), and additive only slightly correlated noise (pink noise, maybe? If you have a nose model, that would be helpful). Is that assessment correct? Dec 18, 2022 at 1:06
• Indeed the question is simple but the nature behind it extremely complex. I made the assumptions you propose, there is no straight way to determine which section of the spectrum is noise and which is signal. Heuristically I would guess that those frequencies must be around 10-30 Hz since I cancelled the rest of the spectrum and the signal was pretty clear and the noise very mitigated. However I cannot find a clear peak in the PSD. Long story short, I don't know where is the noise but I surely know that my signal is around those frequencies even though I cannot find a clear peak in PSD Dec 18, 2022 at 9:00

The “signal” need not be a fundamental frequency, and in many typical cases is quite the opposite: in modulated waveforms the carrier frequency is often suppressed and the resulting waveform has characteristics approaching random waveforms. The “noise” can occupy the same spectrum as the signal, so filtering with simple frequency selective filters is not a valid approach to estimating SNR in any event.

The robust approach to compute SNR in cases like this is to have a reference copy of the waveform with no noise added (which is indeed “signal”) and to use cross correlation; compute the normalized cross correlation coefficient $$\rho$$ and from that the SNR can computed using:

$$SNR =10\log_{10}\bigg( \frac{\rho^2}{1-\rho^2}\bigg)$$

The normalized cross correlation has a range of +/-1, and convert the above to dB with 10Log() to have the SNR expressed in dB.

Further for communication waveforms we may only be interested in what the SNR is at distinct moments in time (the symbol sampling interval), particularly when we want to know what the best SNR would be just prior to decision aftwr we have removed correctable errors such as time and frequency offsets; in which case we may compute the EVM (error vector magnitude) which is the rms error of the complex distance from a given sample at the expected symbol sampling time and the ideal sample. When this is normalized against the rms magnitude of the ideal constellation the SNR can be determined from the EVM using:

$$SNR = -20\log_{10}(EVM)$$

• Thanks for your answer Boschen, very much appreciated. I was suspecting that my noise was folded or overlapped with my signal frequency. Especially in my application where the signal comes from the brain and it is a highly complex and bio-dependent behavior. I need to mention this because as you said if I could have a copy of my reference waveform, I could obtain the normalized cross-correlation. However, imagine that I am just sampling the frequency and I don't know its morphology precisely enough to replicate it. What is normally done in this kind of situation? Dec 18, 2022 at 10:59
• What is normally done is to use a reference waveform regardless to then pass through the identical processing as your unknown signal. With an unknown signal (and assuming no knowledge as to what "good" should be) there is no way to distinguish signal from noise, so by using a known signal in its place, that has a similar spectral occupancy and power level as to what is expected, the added noise due to the signal acquisition and processing can be determined. Otherwise you are asking something similar to "y = m + n. I know y, what is m and what in n?" Dec 18, 2022 at 12:26
• So I should guess a signal with similar spectral "occupancy" as my signal to study, pass it through signal processing and then, repeat the same process with the signal to study. Then expect that there will be a difference in FFT and those frequencies apart from the "replicated" signal could be identified as noise? I could recompose the FFT of the signal with the minimal signal morphology that I aim to obtain but it will be from the reference signal. I have not other way to replicate the brain signal from the electrodes.. Dec 18, 2022 at 16:22
• Not quite. Use the actual captured signal to estimate spectral occupancy (if not known) and total signal power as referenced to the front-end of your acquisition (for this you need to also know your acquisition gain which you can determine with a test tone). Then create a reference signal that is similar to bandlimited white noise and has the spectral occupancy of your signal. With that alone measure the SNR by comparing the output to the reference signal. This will tell you the noise level from all sources (including non-linearities) at that given power setting. Dec 18, 2022 at 17:26
• You may start to get into matching electronics details as well such as source and load impedances when creating your "known reference". Dec 18, 2022 at 17:27