Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Effect of sampling frequency for FFT
Date: Mon, 2 Nov 2009 07:51:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 83
Message-ID: <hcm316$t5p$1@fred.mathworks.com>
References: <hcev3g$lej$1@fred.mathworks.com> <948dc6bf-b104-465e-96de-f862e1e843f6@l35g2000vba.googlegroups.com> <d65291df-9d35-4375-abf6-1915e52fc5c6@m1g2000vbi.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257148262 29881 172.30.248.37 (2 Nov 2009 07:51:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 2 Nov 2009 07:51:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1406655
Xref: news.mathworks.com comp.soft-sys.matlab:581738


Greg Heath <heath@alumni.brown.edu> wrote in message <d65291df-9d35-4375-abf6-1915e52fc5c6@m1g2000vbi.googlegroups.com>...
> 
> On Nov 1, 2:27 am, Greg Heath <he...@alumni.brown.edu> wrote:
> > On Oct 30, 11:01 am, "juho salminen" <jssal...@cc.hut.fi> wrote:
> >
> > > Hi,
> >
> > > I have done some tests with artificial sinusoidial data with white noise added on it. It seems, that the higher sampling frequency I have, the better is signal to noise ratio in FFT. With this I mean, that I take FFT with constant window length, let's say 500 samples. Signal itself is kept constant, let's say 30Hz.
> > > Highter sampling frequency then, of course, reduces the time window size.
> > > This should simulate measurements of some sinusoid with  different sampling frequencies
> >
> > > Do you know what would cause better SNG values, when sampling frequency increases?
> >
> > SNR is independent of Fs.
> >
> > close all, clear all, clc
> >
> > f0   = 30
> > N    = 500
> > S    =  5
> > Ps   = 5^2/2            % = 12.5 Signal Power
> > N0   = 1
> > Pn   = 1                   % = 1   Noise Power
> > SNR0 = Ps/Pn        % 12.5
> > M    = 30                 % No. of trials
> >
> > rand('state',0)
> > randn('state',0)
> >
> > for i = 1:M
> >
> >     Fs(i) = f0*i;        % Sampling Frequency
> >     dt    = 1/Fs(i)
> >     t     = dt*(0:N-1);
> >     s     = S*cos(2*pi*(f0*t+rand(1,N)));
> 
>       s     = S*cos(2*pi*(f0*t+rand));
> 
> >     n     = N0*randn(1,N);
> >
> >     vars(i) = var(s);
> >     varn(i) = var(n);
> >     SNR(i)  = var(s)/var(n);
> >
> > end
> >
> > summary = [Fs' vars' varn' SNR']
> -----SNIP
> 
> % Exclude cases Fs < = 2*f0
> meansummary = mean(summary(3:M,2:4))
> stdsummary  = std(summary(3:M,,2:4))
> > meanSNR = meansummary(3)
> > stdSNR = stdsummary(3)
> -----SNIP
> 
>  % Restricting to Fs > 2*f0.
> 
> Fs1 = Fs(3:M);
> M1  = M-2
> 
> figure,hold on
> plot(Fs1,SNR0*ones(1,M1),'k')
> plot(Fs1,meanSNR*ones(1,M1),'r')
> plot(Fs1,(meanSNR-stdSNR)*ones(1,M1),'r--')
> plot(Fs1,(meanSNR+stdSNR)*ones(1,M1),'r--')
> plot(Fs1,SNR(3:M))
> 
> > axis([0 M*f0 0 20])
> > xlabel('Sampling Frequency (Hz)')
> > ylabel('Signal-to-Noise Ratio')
> > title('SNR Estimate vs Sampling Frequency')
> 
> Hope this helps.
> 
> Greg


Hi, 

doesn't this basically mean, that there is no SNR improvement, when sampling frequency is increased?

-Juho