help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Any FFT expert around?


From: oxy
Subject: Any FFT expert around?
Date: Wed, 12 Feb 2014 14:22:05 +0100

hey guys,

the (simple) code bellow is how i ve learned to do FFT according to
several docs online. However i observe a dependency of the signal
frequency in the spectrum on the constant FsFactor. In other words,
the signal frequency depends on the sampling rate. I should'nt be,
right? So what is wrong here?

  #---------- start code ------------
  clear all
  nu=10;                    % signal frequency
  at=5;                       % acquisition time
  T1=2                       % signal decay constant in time domain
  FsFactor=8;             % the ratio (sampling rate)/(signal
frequency), or Fs/nu

  clf
  Fs = FsFactor*nu;                             % Sampling rate
  t = ((0:(at*Fs-1))/Fs)';                         % Time vector
  freq=linspace(-1,1,Fs*at)' * Fs/2;         % frequency vector
  tdsig=exp(-i*2*pi*nu*t).*exp(-t./(T1));    % time domain signal
  freqsig=fft(tdsig);                                % freq. domain signal
  subplot(1,2,1)
  plot(t,tdsig)
  axis([ 0 0.4])       % zooming time domain to see that period=1/nu
  subplot(1,2,2)
  plot(freq, freqsig)
  #---------- end code ------------

Do it yourself. Just rerun the code trying different values of
FsFactor (eg: 2, 4, 8).
Thx a lot for any hint!!!

oxy

ps: cross post 
http://www.mathworks.com/matlabcentral/answers/115700-fft-why-signal-frequency-depends-on-sampling-rate


reply via email to

[Prev in Thread] Current Thread [Next in Thread]