📄 plotdft.m
字号:
function plotdft(x, fs)
%plots fft of x versus frequency for 0..fs/2
% where fs is the sampling frequency in Hz
% usage: plotdft(x, fs)
N=length(x); %set length
f=[0:fs/(N-1):fs/2]; %calculate frequency sample points
dft=abs(fft(x)); %calculate DFT
stem(f,dft(1:N/2)); %produce plot
axis([0, fs/2,0,max(dft)]); %scale axis to keep them neat!
title('DFT 0..fs/2'); %finally, label every thing...
xlabel('frequency (Hz)');
ylabel('amplitude');
%David Phillips 09507351
%Curtin Univeristy Linear systems 202
%23 October 2000
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -