to read a instantanious amplitude

we have performed and fast Fourier transform and now we have to take the amplitude of the second harmonics or any harmonics so please help us to how we can store that amplitude in a variable.

Answers (1)

The discrete Fourier coefficient is not an instantaneous amplitude, but you can store the DFT coeffcient as a variable by simply extracting it from the vector. The following code shows you how to save the complex-valued DFT coefficient for the 20-Hz sine wave to a variable, camp
Fs = 100;
t =0:1/100:1-1/100;
x = cos(2*pi*20*t);
xdft = fft(x);
camp = xdft(21);

Asked:

on 24 Jan 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!