amplitude of (signal) after fft operation - matlab answers - matlab central
TRANSCRIPT
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 15
Asked by Mary Jon on 15 Nov 2014
Latest activity Commented on by Mary Jon on 26 Nov 2014
Accepted Answer by Matt
I have this code I am suppose sin of amplitude 10 with frequency 200hz and
sampling frequency 20000 hz and do FFT on this signal
why the Amplitude after FFT is 1000 where the amplitude must be stay 10
983110983155 983101 983090983088983088983088983088983099
983156 983101 983088983098983089983087983110983155983098983088983086983088983089983099
983142983139983089983101983090983088983088983099
983160 983101 983089983088983082983155983145983150(983152983145983082983142983139983089983082983156)
983160983101983160983099
983160983110983110983124 983101 983137983138983155(983142983142983156(983160))983099
983160983108983110983124983135983152983155983140 983101 983137983138983155(983142983142983156(983160)983086983134983090)983099
fft
MATLAB
New to MATLAB
Learn MATLAB
today
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 25
Answer by Matt on 15 Nov 2014
Edited by Matt on 17 Nov 2014
Accepted answer
Mary
In general to return a FFT amplitude equal to the amplitude signal
which you input to the FFT you need to normalize FFTs by the
number of sample points youre inputting to the FFT
983110983155 983101 983090983088983088983088983088983099
983156 983101 983088983098983089983087983110983155983098983088983086983088983089983099
983142983139983089983101983090983088983088983099
983160 983101 983089983088983082983155983145983150(983152983145983082983142983139983089983082983156)
983160983101983160983099
983160983110983110983124 983101 983137983138983155(983142983142983156(983160))983087983148983141983150983143983156983144(983160)983099
983160983108983110983124983135983152983155983140 983101 983137983138983155(983142983142983156(983160)983086983134983090)983099
Note that doing this will divide the power between the positive and
negative sides so if you are only going to look at one side of the
FFT you can multiply the xFFT by 2 and youll get the magnitude
of 10 that youre expecting
The fft documentation has a pretty good example that illustrates
this and some other fft best practices
httpwwwmathworkscomhelpmatlabrefffthtml
Edited for clarity - see Matt Js comment for the original
statement
Show 2 older comments
Matt J on 16
Nov 2014 Link
In general you need to normalize FFTs by thenumber of points youre inputting to the FFT
Link
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 35
Thats true if the FFT is being used to compute
Fourier Series coefficients If the idea is to
approximate a continuous Fourier Transform
integral the FFT needs to be scaled by the time
sampling interval 1Fs If the idea is to preserve
signal energy (Paresevals theorem) the FFT
needs to be normalized by 1sqrt(N)
Mary Jon on 16
Nov 2014 Link
how can I scale by time sampling interval please
Matt J on 17
Nov 2014 Link
As follows but it doesnt sound like that is the type
of scaling your situation requires
983140983141983148983156983137983124983101983089983087983110983155983099 983156983145983149983141 983155983137983149983152983148983145983150983143 983145983150983156983141983154983158
983160983110983110983124 983101 983137983138983155(983142983142983156(983160)983082983140983141983148983156983137983124)983099
Answer by Matt J on 16 Nov 2014Edited by Matt J on 16 Nov 2014
You also have to be careful about how you design your frequency
space sampling In your current code the frequency sampling
interval is Fslength(t)=995025 Hz But the frequency you are
trying to sample is at 100 Hz so your Fourier Space sampling will
never hit this And because the spectrum is sharply peaked you
can get significant errors with this deviation
Link
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 45
Mary Jon on 16
Nov 2014 Link
I need only calculate fft and PSD of sin wave with
frequency 200hz and sampling frequency
20000hz
this code represent as a test on well known signal
(sin) to help me how do this (FFT) in signals of my
project
Matt J on 16
Nov 2014 Link
The signal youve shown is 100 Hz A 200 Hz
sinewave would have fc1=400
But Im not sure you caught my point The
amplitude of the FFT result will depend not only on
the sampling frequency Fs but also the number of
samples length(x) Below for example we seethat the peak amplitude of xFFT is not really
exactly 1000 until you drop one sample
983102983102 983149983137983160( 983137983138983155( 983142983142983156(983160) ) )
983137983150983155 983101
983089983086983088983088983090983091983141983083983088983091
983102983102 983149983137983160( 983137983138983155( 983142983142983156(983160(983089983098983141983150983140983085983089)) )
983137983150983155 983101
983089983088983088983088
Mary Jon on 26
Nov 2014 Link
ok matt the x-axis represent numbers of sample
(201)isnt itHow can I (modify in code) to made xaxis of xFFT in frequency unit please
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 55
close
ct link to this comment
wwwmathworkscommatlabcentral
wers162846comment_249975
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 25
Answer by Matt on 15 Nov 2014
Edited by Matt on 17 Nov 2014
Accepted answer
Mary
In general to return a FFT amplitude equal to the amplitude signal
which you input to the FFT you need to normalize FFTs by the
number of sample points youre inputting to the FFT
983110983155 983101 983090983088983088983088983088983099
983156 983101 983088983098983089983087983110983155983098983088983086983088983089983099
983142983139983089983101983090983088983088983099
983160 983101 983089983088983082983155983145983150(983152983145983082983142983139983089983082983156)
983160983101983160983099
983160983110983110983124 983101 983137983138983155(983142983142983156(983160))983087983148983141983150983143983156983144(983160)983099
983160983108983110983124983135983152983155983140 983101 983137983138983155(983142983142983156(983160)983086983134983090)983099
Note that doing this will divide the power between the positive and
negative sides so if you are only going to look at one side of the
FFT you can multiply the xFFT by 2 and youll get the magnitude
of 10 that youre expecting
The fft documentation has a pretty good example that illustrates
this and some other fft best practices
httpwwwmathworkscomhelpmatlabrefffthtml
Edited for clarity - see Matt Js comment for the original
statement
Show 2 older comments
Matt J on 16
Nov 2014 Link
In general you need to normalize FFTs by thenumber of points youre inputting to the FFT
Link
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 35
Thats true if the FFT is being used to compute
Fourier Series coefficients If the idea is to
approximate a continuous Fourier Transform
integral the FFT needs to be scaled by the time
sampling interval 1Fs If the idea is to preserve
signal energy (Paresevals theorem) the FFT
needs to be normalized by 1sqrt(N)
Mary Jon on 16
Nov 2014 Link
how can I scale by time sampling interval please
Matt J on 17
Nov 2014 Link
As follows but it doesnt sound like that is the type
of scaling your situation requires
983140983141983148983156983137983124983101983089983087983110983155983099 983156983145983149983141 983155983137983149983152983148983145983150983143 983145983150983156983141983154983158
983160983110983110983124 983101 983137983138983155(983142983142983156(983160)983082983140983141983148983156983137983124)983099
Answer by Matt J on 16 Nov 2014Edited by Matt J on 16 Nov 2014
You also have to be careful about how you design your frequency
space sampling In your current code the frequency sampling
interval is Fslength(t)=995025 Hz But the frequency you are
trying to sample is at 100 Hz so your Fourier Space sampling will
never hit this And because the spectrum is sharply peaked you
can get significant errors with this deviation
Link
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 45
Mary Jon on 16
Nov 2014 Link
I need only calculate fft and PSD of sin wave with
frequency 200hz and sampling frequency
20000hz
this code represent as a test on well known signal
(sin) to help me how do this (FFT) in signals of my
project
Matt J on 16
Nov 2014 Link
The signal youve shown is 100 Hz A 200 Hz
sinewave would have fc1=400
But Im not sure you caught my point The
amplitude of the FFT result will depend not only on
the sampling frequency Fs but also the number of
samples length(x) Below for example we seethat the peak amplitude of xFFT is not really
exactly 1000 until you drop one sample
983102983102 983149983137983160( 983137983138983155( 983142983142983156(983160) ) )
983137983150983155 983101
983089983086983088983088983090983091983141983083983088983091
983102983102 983149983137983160( 983137983138983155( 983142983142983156(983160(983089983098983141983150983140983085983089)) )
983137983150983155 983101
983089983088983088983088
Mary Jon on 26
Nov 2014 Link
ok matt the x-axis represent numbers of sample
(201)isnt itHow can I (modify in code) to made xaxis of xFFT in frequency unit please
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 55
close
ct link to this comment
wwwmathworkscommatlabcentral
wers162846comment_249975
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 35
Thats true if the FFT is being used to compute
Fourier Series coefficients If the idea is to
approximate a continuous Fourier Transform
integral the FFT needs to be scaled by the time
sampling interval 1Fs If the idea is to preserve
signal energy (Paresevals theorem) the FFT
needs to be normalized by 1sqrt(N)
Mary Jon on 16
Nov 2014 Link
how can I scale by time sampling interval please
Matt J on 17
Nov 2014 Link
As follows but it doesnt sound like that is the type
of scaling your situation requires
983140983141983148983156983137983124983101983089983087983110983155983099 983156983145983149983141 983155983137983149983152983148983145983150983143 983145983150983156983141983154983158
983160983110983110983124 983101 983137983138983155(983142983142983156(983160)983082983140983141983148983156983137983124)983099
Answer by Matt J on 16 Nov 2014Edited by Matt J on 16 Nov 2014
You also have to be careful about how you design your frequency
space sampling In your current code the frequency sampling
interval is Fslength(t)=995025 Hz But the frequency you are
trying to sample is at 100 Hz so your Fourier Space sampling will
never hit this And because the spectrum is sharply peaked you
can get significant errors with this deviation
Link
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 45
Mary Jon on 16
Nov 2014 Link
I need only calculate fft and PSD of sin wave with
frequency 200hz and sampling frequency
20000hz
this code represent as a test on well known signal
(sin) to help me how do this (FFT) in signals of my
project
Matt J on 16
Nov 2014 Link
The signal youve shown is 100 Hz A 200 Hz
sinewave would have fc1=400
But Im not sure you caught my point The
amplitude of the FFT result will depend not only on
the sampling frequency Fs but also the number of
samples length(x) Below for example we seethat the peak amplitude of xFFT is not really
exactly 1000 until you drop one sample
983102983102 983149983137983160( 983137983138983155( 983142983142983156(983160) ) )
983137983150983155 983101
983089983086983088983088983090983091983141983083983088983091
983102983102 983149983137983160( 983137983138983155( 983142983142983156(983160(983089983098983141983150983140983085983089)) )
983137983150983155 983101
983089983088983088983088
Mary Jon on 26
Nov 2014 Link
ok matt the x-axis represent numbers of sample
(201)isnt itHow can I (modify in code) to made xaxis of xFFT in frequency unit please
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 55
close
ct link to this comment
wwwmathworkscommatlabcentral
wers162846comment_249975
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 45
Mary Jon on 16
Nov 2014 Link
I need only calculate fft and PSD of sin wave with
frequency 200hz and sampling frequency
20000hz
this code represent as a test on well known signal
(sin) to help me how do this (FFT) in signals of my
project
Matt J on 16
Nov 2014 Link
The signal youve shown is 100 Hz A 200 Hz
sinewave would have fc1=400
But Im not sure you caught my point The
amplitude of the FFT result will depend not only on
the sampling frequency Fs but also the number of
samples length(x) Below for example we seethat the peak amplitude of xFFT is not really
exactly 1000 until you drop one sample
983102983102 983149983137983160( 983137983138983155( 983142983142983156(983160) ) )
983137983150983155 983101
983089983086983088983088983090983091983141983083983088983091
983102983102 983149983137983160( 983137983138983155( 983142983142983156(983160(983089983098983141983150983140983085983089)) )
983137983150983155 983101
983089983088983088983088
Mary Jon on 26
Nov 2014 Link
ok matt the x-axis represent numbers of sample
(201)isnt itHow can I (modify in code) to made xaxis of xFFT in frequency unit please
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 55
close
ct link to this comment
wwwmathworkscommatlabcentral
wers162846comment_249975
8202019 Amplitude of (Signal) After FFT Operation - MATLAB Answers - MATLAB Central
httpslidepdfcomreaderfullamplitude-of-signal-after-fft-operation-matlab-answers-matlab-central 55
close
ct link to this comment
wwwmathworkscommatlabcentral
wers162846comment_249975