alias.m
来自「This program illustrates the effect of a」· M 代码 · 共 23 行
M
23 行
% This program illustrates the effect of alising
% of frequency leading to signal distortion
fs =10000; % sampling frequency
ts = 1/fs;
n = (1:50)*ts;
N = 1000; %No of points in DFT
fr = fs/N;
m = (1:1000)*fr;
for f=1000:2000:9000;
x=sin(2*pi*f*(0:2000)/10000+pi/4);
plot(n,x(1:50)), title('sine waveform')
xlabel('time'), ylabel('amplitude')
pause
y = abs(fft(x,1000));
plot(m,y), title('frequency response')
xlabel('frequency '), ylabel('magnitude')
pause
soundsc(x)
pause
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?