Borrar filtros
Borrar filtros

How to find frequency contents in this signal below?

1 visualización (últimos 30 días)
Abhishek Nayak
Abhishek Nayak el 20 de Ag. de 2019
Editada: Adam Danz el 26 de Ag. de 2019
  2 comentarios
Abhishek Nayak
Abhishek Nayak el 20 de Ag. de 2019
Editada: Abhishek Nayak el 20 de Ag. de 2019
Thanks for answering the question, but I was not able to get the adequate results by using fft. Can you please figure out the probem in the folowing code
The code I followed is shown below.
%% to obatin the datas in the figure
h = findobj(gca,'Type','line')
x=get(h,'Xdata') ;
y=get(h,'Ydata') ;
%% using fft to obtain the frequency contents in the signal
sam=x(end)/length(x); % sampling time
X=fft(y); % using fft
P2=abs(X/length(X)); % To normalize and obtain magnitude
P1=P2(1:1+(length(X)+1)/2); % To compute the single-sided spectrum P1
fre=(1/sam)*(0:(length(X)+1)/2); % To obtain the spread of freqency
figure(25)
plot(fre,P1) % To plot the frequency contents in the signal
It can be seen from the asked figure that the freqency contenets are in low freqency range but the obtained results are in very fast freqency range.

Iniciar sesión para comentar.

Respuestas (1)

Abhishek Nayak
Abhishek Nayak el 26 de Ag. de 2019
Editada: Adam Danz el 26 de Ag. de 2019
I figured it out finaly,
there was a mistake in the code
%% to obatin the datas in the figure
h = findobj(gca,'Type','line')
x=get(h,'Xdata') ;
y=get(h,'Ydata') ;
%% using fft to obtain the frequency contents in the signal
sam=x(end)/length(x); % sampling time
X=fft(y); % using fft
P2=abs(X/length(X)); % To normalize and obtain magnitude
P1=P2(1:1+(length(X)+1)/2); % To compute the single-sided spectrum P1
fre=(1/sam)*(0:(length(X)+1)/2)/length(X); % To obtain the spread of freqency
figure(25)
plot(fre,P1) % To plot the frequency contents in the signal

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by