MATLAB: HOW DO I GET AMPLITUDE AND FREQUENCY FROM A WAVE SIGNAL

please help me..

i have a wave signal data in the form of time and phase..how do i get the amplitude and frequency from it?

Best Answer

Use the discrete Fourier transform. Here is an example.
t = 0:0.001:1-0.001; % sampled at 1 kHz
x = cos(2*pi*100*t); % 100-Hz sine wave
xdft = fft(x); % Obtain the DFT

camp = 2/length(x)*xdft(101);
You see that camp is 1. Now let's change the phase.
x = cos(2*pi*100*t-pi/4); % 100-Hz sine wave -- phase shift -pi/4
xdft = fft(x); % Obtain the DFT
camp = 2/length(x)*xdft(101);
abs(camp) % amplitude
angle(camp) % phase
To get the frequency, you have to know how to convert between the DFT "bins" and a meaningful frequency
In my example, the sampling frequency is 1000 Hz, and the DFT bins are spaced at Fs/length(x). You have to keep in mind that the first bin is 0 Hz. Here I get the frequency of the maximum.
[~,index] = sort(abs(xdft),'descend');
Fs = 1000;
(index(1)*Fs)/length(x)-(Fs/length(x))