Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

question on fft example

11 views
Skip to first unread message

oversky

unread,
Nov 15, 2012, 3:33:13 AM11/15/12
to
The mathwork fft example in the following link,
http://bit.ly/SO9TuV
why do we double abs(Y(1:NFFT/2+1) when plotting the amplitude?

plot(f,2*abs(Y(1:NFFT/2+1)))

Nasser M. Abbasi

unread,
Nov 15, 2012, 3:37:35 AM11/15/12
to
This was talked about before. can google it. Here is my take on it:

"Why does it multiply by 2?"

http://12000.org/my_notes/on_scaling_factor_for_ftt_in_matlab/index.htm

--Nasser

oversky

unread,
Nov 15, 2012, 4:40:29 AM11/15/12
to
Thank you. I found a lot of useful material in your website.

Greg Heath

unread,
Nov 17, 2012, 5:49:10 AM11/17/12
to
"Nasser M. Abbasi" <n...@12000.org> wrote in message <k829kk$hv6$1...@speranza.aioe.org>...
To represent the same average power as the doublesided frequency representation.

the DC and Nyquist components should NOT be doubled.

plot((0:Fs/2), [abs(Y(1)), 2*abs(Y(2:NFFT/2)), abs(Y(NFFT/2+1)) ] )

Hope this helps.

Greg

Nasser M. Abbasi

unread,
Nov 17, 2012, 6:10:19 AM11/17/12
to
hi Greg;

Its been a while since I looked at this myself, so I am rusty now
to remember all the details (that is why I write down everything
before I forget it) but there were different views on these scaling
factors. Here is the same question, asked in 2009 here FYI

http://www.mathworks.com/matlabcentral/newsreader/view_thread/261034

--Nasser

Greg Heath

unread,
Nov 17, 2012, 11:02:14 PM11/17/12
to
"Nasser M. Abbasi" <n...@12000.org> wrote in message <k87rb1$edu$1...@speranza.aioe.org>...
Oh yeah.

1. In single-sided power and amplitude spectra, DC and Nyquist are never doubled
2. Other power spectrum components are doubled
3. Other amplitude spectrum components should be multiplied by sqrt(2)
because when they are squared they should represent the power spectrum.

Greg
0 new messages