SNR goes down as noise filtering is increased.

Hello friends. I have a question regarding filtering noise from noisy signals. I filtered a signal (data attached to this post) using Wiener2 with a window size of 3 and 11. I then subtracted the filtered signal from the orginal signal to get noise. Surprisingly, the SNR for the more filtered signal (corresponding to window size of 11) is lesser than the least filtered. Could this be due to the signal getting attenuated along with the noise ? Any direction to this issue will be much appreciated. The code is also attached. Thank you.
%% SNR comparision befrore and after filtering noise
%noisydata = readmatrix("Data_response_thickJn_1W_IPA_set1_5.csv");
load ("noisyData.mat")
noisydata = data;
time = noisydata(:,1);
temp = noisydata(:,2);
% filtering using Wiener filter
filteredTemp1 = wiener2(temp,[3,1]); %low filter window
noise1 = temp - filteredTemp1;
SNR1 = snr(temp,noise1)
SNR1 = 45.2032
filteredTemp2 = wiener2(temp,[11,1]); %high filter window
noise2 = temp - filteredTemp2;
SNR2 = snr(temp,noise2)
SNR2 = 41.4500

4 Comments

Stephen23
Stephen23 on 22 Mar 2026 at 7:59
Edited: Stephen23 on 22 Mar 2026 at 8:00
"Could this be due to the signal getting attenuated along with the noise ?"
Yes, this is likely the main cause. In general there is no such thing as filtering that only removes noise (leaving only the pure "signal"), filtering also attenuate (or affects in other ways) the signal itself. What is your goal?
Hello Stephen. Thank you for your response. I want to get a filtering criterion for the best SNR. Or to get an idea about the noise level such that I can go ahead with a filtering procedure and say the variation in the measured signal could vary so much because of the noise.
Hi Vijayananda,
Here is a handwaving argument for why the SNR for window 11 might be less than the SNR for window 3. First of all, the method of
signal - presumed signal = presumed noise
has issues from the get-go. Suppose you create a filtered signal and come up with an SNR. If someone were to take your filter and apply an across the board factor of, say, -1dB to it, then the SNR should not change. But as you have alluded to in your question, by the method above it would change. There are too many innocuous ways to change the filtering process and affect the results when that method is used.
Now for the handwaving. If the Wiener filter acts more or less as a moving window in the spacial domain (I am not saying that it does for sure), then consider what goes on in the frequency domain. Window 3 acts as a low pass filter with a characteristic cutoff frequency proportional to 1/3, and window 11 acts as a low pass filter with a characteristic cutoff frequency proportional to 1/11, significantly smaller. Consequently window 11 rejects a lot more high frequency content than window 3 does. By the method you are using all of that high frequency content (both authentic signal and noise), is presumed to be noise. So window 11 can have more presumed noise and therefore a lower SNR.
Thank you so much, David. This is insightfull.

Sign in to comment.

Answers (2)

Matt J
Matt J on 22 Mar 2026 at 12:26
Edited: Matt J on 23 Mar 2026 at 14:21
Depending on the data you provide, the theoretical assumptions of a Wiener filter (signal stationarity, white noise, etc...) are not always well satisfied at a particular sliding window position and for a particular window size. There is also no certainty that increasing the window size will improve the assumptions. Finally, the implementation of the filter by wiener2 is also only an approximation of the ideal one given by the Wiener-Hopf formula,
Therefore, SNR-maximization is not always observed.

4 Comments

Thank you Matt. So, in practice, we can only assume the noise and go with it. right?
Matt J
Matt J on 23 Mar 2026 at 17:01
Edited: Matt J on 23 Mar 2026 at 17:03
Not sure what that means.
The algorithm used by wiener2 is here,
Among other things, you can see that it is assuming that the only deterministic part of the signal within the window is a constant, represented by the pixel mean μ. if you make the window too big, that approximation breaks down and affects the calculation of .
What I meant by my previous statement is that if we have a noisy signal, do we have a reliable method to remove noise as much as possible? Or removing noise always causes a removal of signal leading to loss of information?
"What I meant by my previous statement is that if we have a noisy signal, do we have a reliable method to remove noise as much as possible?"
No, in general this is impossible. If this was possible then all signals of any data would be trivially delivered with zero noise. Your headphones would deliver exactly the sound that occured in the concert hall: wouldn't that be nice!
"Or removing noise always causes a removal of signal leading to loss of information?"
In general this is likely true, unless you can rely on some prior knowledge about the nature of the signal, or the nature of the encoding, or the nature of the noise, etc.

Sign in to comment.

You are measuring noise incorrectly. For that, you must use the clean signal --
Signal=double(im2gray(imread('peppers.png')));
temp=Signal+50*randn(size(Signal));
clear SNR
win=3:21;
for k=1:length(win)
filteredTemp = wiener2(temp,[win(k),1]); %low filter window
noise = filteredTemp - Signal;
SNR(k)=snr(temp,noise);
end
figure
plot(SNR)
xlabel Window
ylabel SNR
Also, if the original SNR is too low, wiener2 can mistake your signal for noise --
Signal=double(im2gray(imread('peppers.png')));
temp=Signal+0*randn(size(Signal));
clear SNR
win=3:21;
for k=1:length(win)
filteredTemp = wiener2(temp,[win(k),1]); %low filter window
noise = filteredTemp - Signal;
SNR(k)=snr(temp,noise);
end
figure
plot(SNR)
xlabel Window
ylabel SNR

4 Comments

Thank you so much for your answer. However, the data that I gave in the original post was measured signal and that is noisy. We can't get a clean signal in real life measurement right?
Right. Although, you can try to approximate a clean signal using a heavily filtered baseline --
Signal=double(im2gray(imread('peppers.png')));
temp=Signal+50*randn(size(Signal));
Baseline=wiener2(temp,[21,1]);
clear SNR
win=3:21;
for k=1:length(win)
filteredTemp = wiener2(temp,[win(k),1]); %low filter window
noise = filteredTemp - Baseline;
SNR(k)=snr(temp,noise);
end
figure
plot(SNR)
xlabel Window
ylabel SNR
Vijayananda
Vijayananda on 24 Mar 2026 at 19:05
Edited: Vijayananda on 24 Mar 2026 at 19:10
noise = filteredTemp - Baseline;
Is this the right approach for noise calculation? noise should be noisy signal - filtered signal/baseline right ?
if temp=Signal+50*randn(size(Signal));
where 50*randn(size(Signal)) is the noise, then Signal should be temp-noise mathematically right ?
Catalytic
Catalytic on 24 Mar 2026 at 19:22
Edited: Catalytic on 24 Mar 2026 at 19:31
noise should be noisy signal - filtered signal/baseline right ?
In general terms, noise should be "noisy_signal - true_signal", but there are two important points --
(1) You are trying to quantify the noise that remains after filtering with wiener2, so in this case noisy_signal = filteredTemp. You want to know the amount of noise still in filteredTemp.
(2) As you said, you do not have access to "true_signal", so my proposal was to approximate it with an extra heavily filtered version of temp (Baseline)
if temp=Signal+50*randn(size(Signal)); where 50*randn(size(Signal)) is the noise, then Signal should be temp-noise mathematically right ?
50*randn(size(Signal)) is the original noise in the corrupted signal, yes, but as I point out above in (1), the original noise is not the noise you are interested in. You are interested in measuring the noise that remains after the corrupted signal passes through the filter.

Sign in to comment.

Categories

Find more on Audio Processing Algorithm Design in Help Center and File Exchange

Asked:

on 21 Mar 2026 at 19:37

Edited:

on 24 Mar 2026 at 19:31

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!