How to see a part of my FFT plot in magnified size in other window?

조회 수: 5 (최근 30일)
Deepika
Deepika 2014년 1월 8일
댓글: Deepika 2014년 1월 8일
I have drawn a FFT plot for my data and now I want to show a particular part of my plot in zoom. How to do it , Please guide me?

답변 (2개)

Wayne King
Wayne King 2014년 1월 8일
You can simply use
>>zoom on
Or you can set your xlim and/or ylim properties appropriately:
Fs = 1000;
t = 0:1/Fs:1;
x = cos(2*pi*100*t)+randn(size(t));
xdft = fft(x);
plot(abs(xdft))
% now do the following
set(gca,'xlim',[0 200])
You can do the same for the 'ylim' as well if you like.
Or finally, you can just plot the relative portion of the output of fft() to begin with:
plot(abs(xdft(1:201)))
  댓글 수: 1
Deepika
Deepika 2014년 1월 8일
Sorry Mr. Wayne King. But this is not what I want. I have to mark an area of the plot and den show it into some window. I am attaching a plot here. You may then understand my need. Kindly help me out.

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


Wayne King
Wayne King 2014년 1월 8일
You can do something like that with subplot
Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*100*t)+randn(size(t));
xdft = fft(x);
xdft = xdft(1:length(x)/2+1);
df = Fs/length(x);
freqvec = 0:df:Fs/2;
subplot(211)
plot(freqvec,abs(xdft)); xlabel('Hz');
subplot(212)
plot(freqvec(1:201),abs(xdft(1:201)));
xlabel('Hz');
Why do you need to have that callout graphic like you show in your document. You can do that, but it is much more complicated and what purpose does it serve?
  댓글 수: 1
Deepika
Deepika 2014년 1월 8일
Mr. Wayne King, Thanks for the reply. But the method you suggested is not needed. I show you the way I want the plot in attached document. So, please help me out. I have a plot which shows disturbed harmonics and I have to it sinusoidal nature so I need the zoomed portion of a particular part of a plot to prove it.

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

카테고리

Help CenterFile Exchange에서 Data Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by