HOW DO I GET AMPLITUDE AND FREQUENCY FROM A WAVE SIGNAL

12 visualizaciones (últimos 30 días)
Ron
Ron el 22 de Ag. de 2012
Respondida: komal kumar el 1 de Oct. de 2019
i have a wave signal data in the form of time and phase..how do i get the amplitude and frequency from it?

Respuesta aceptada

Wayne King
Wayne King el 22 de Ag. de 2012
Editada: Wayne King el 22 de Ag. de 2012
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))
  2 comentarios
André Luiz Regis Monteiro
André Luiz Regis Monteiro el 6 de Ag. de 2014
Wayne, why do you use xdft(101)? Why 101? In your example you got the frequency of the maximum, but if my signal is composed by 4 signals added, how can I get this 4 frequencies? Thanks a lot.
poornima.a A
poornima.a A el 29 de En. de 2018
i am also having the same dounbt,why you had used that 101? what it means?.plz give the detailed answer sir

Iniciar sesión para comentar.

Más respuestas (2)

James Muller
James Muller el 25 de Sept. de 2012
How can I get the phase angle of an obtained signal?

komal kumar
komal kumar el 1 de Oct. de 2019
angle(101)

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by