필터 지우기
필터 지우기

How to find frequency contents in this signal below?

조회 수: 1 (최근 30일)
Abhishek Nayak
Abhishek Nayak 2019년 8월 20일
편집: Adam Danz 2019년 8월 26일
  댓글 수: 2
Abhishek Nayak
Abhishek Nayak 2019년 8월 20일
편집: Abhishek Nayak 2019년 8월 20일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Abhishek Nayak
Abhishek Nayak 2019년 8월 26일
편집: Adam Danz 2019년 8월 26일
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

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by