From: Martijn Roelofsz on
I am trying to plot an fft of a known sinusoid signal.
The input signal is a 20mVtt, 200Hz sinus. Duration is 0.2sec. 500kHz samplerate.
When i calculate the fft I expect a spike at 200Hz with a magnitude of 10(in this case mV).

y = fft(X);
m = abs(y);
plot(m);

The fft shows a amplitude of 4.6922 at 200Hz. Why is it not 10(or very close to 10) and how can I scale it back to mV again?
From: Lothar Schmidt on
Am 12.07.2010 14:45, schrieb Martijn Roelofsz:
> I am trying to plot an fft of a known sinusoid signal.
> The input signal is a 20mVtt, 200Hz sinus. Duration is 0.2sec. 500kHz
> samplerate.
> When i calculate the fft I expect a spike at 200Hz with a magnitude of
> 10(in this case mV).
> y = fft(X);
> m = abs(y);
> plot(m);
>
> The fft shows a amplitude of 4.6922 at 200Hz. Why is it not 10(or very
> close to 10) and how can I scale it back to mV again?

one keyword interesting to you is leakage
From: Greg Heath on
On Jul 12, 8:45 am, "Martijn Roelofsz" <martijn.roelo...(a)nlr.nl>
wrote:
> I am trying to plot an fft of a known sinusoid signal.
> The input signal is a 20mVtt,

What does "tt" mean?

>200Hz sinus. Duration is 0.2sec. 500kHz samplerate.

Fs = 5e5
tmax = 0.2
dt = 1/Fs % 2e-6

% t = 0:dt:T-dt;
% t = dt*(0:N-1);

T = tmax+dt % 0.200002
N = T/dt % 100001

> When i calculate the fft I expect a spike at 200Hz with a magnitude of 10(in this case mV).
>
> y = fft(X);

y = fft(X)/N; % will give the correct spectrum scale

> m = abs(y);
> plot(m);
>
> The fft shows a amplitude of 4.6922 at 200Hz. Why is it not 10(or very close to 10) and how can I scale it back to mV again?


It's not clear how you obtained that number.

Hope this helps.

Greg
Greg
From: Martijn Roelofsz on
Greg Heath <heath(a)alumni.brown.edu> wrote in message <0f2e8b34-9dc2-44b9-9e16-dcc474e036af(a)i1g2000vbk.googlegroups.com>...
> On Jul 12, 8:45 am, "Martijn Roelofsz" <martijn.roelo...(a)nlr.nl>
> wrote:
> > I am trying to plot an fft of a known sinusoid signal.
> > The input signal is a 20mVtt,
>
> What does "tt" mean?
>
> >200Hz sinus. Duration is 0.2sec. 500kHz samplerate.
>
> Fs = 5e5
> tmax = 0.2
> dt = 1/Fs % 2e-6
>
> % t = 0:dt:T-dt;
> % t = dt*(0:N-1);
>
> T = tmax+dt % 0.200002
> N = T/dt % 100001
>
> > When i calculate the fft I expect a spike at 200Hz with a magnitude of 10(in this case mV).
> >
> > y = fft(X);
>
> y = fft(X)/N; % will give the correct spectrum scale
>
> > m = abs(y);
> > plot(m);
> >
> > The fft shows a amplitude of 4.6922 at 200Hz. Why is it not 10(or very close to 10) and how can I scale it back to mV again?
>
>
> It's not clear how you obtained that number.
>
> Hope this helps.
>
> Greg
> Greg

tt is the top to top voltage. In this case 20mV.
From: Steve Amphlett on
"Martijn Roelofsz" <martijn.roelofsz(a)nlr.nl> wrote in message <i1f2ok$1cv$1(a)fred.mathworks.com>...
> I am trying to plot an fft of a known sinusoid signal.
> The input signal is a 20mVtt, 200Hz sinus. Duration is 0.2sec. 500kHz samplerate.
> When i calculate the fft I expect a spike at 200Hz with a magnitude of 10(in this case mV).
>
> y = fft(X);
> m = abs(y);
> plot(m);
>
> The fft shows a amplitude of 4.6922 at 200Hz. Why is it not 10(or very close to 10) and how can I scale it back to mV again?

Putting leakage to one side, you are mainly not using the number of points to scale your transform.

N=length(X);
m=abs(y)*2/N;

(Note that the DC and Nyquist frequencies should only be scaled by 1/N, but that detail isn't hugely important here.)
 |  Next  |  Last
Pages: 1 2 3
Prev: Recent File List/MatLAB GUI
Next: Surf plot with NaN