加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

周期性信号经过等间隔采样不一定得到周期序列

(2013-03-25 02:12:07)
分类: 信号处理
http://s12/mw690/5dfd405dtd8afbad0bd0b&690

http://s11/mw690/5dfd405dtd8afbb10207a&690


% 此範例展示一個簡單正弦波的傅立葉轉換,以雙邊頻譜來顯示
% 此正弦波的頻率恰巧是 freqStep 的整數倍,所以雙邊頻譜應該只有兩個非零點

N = 256;                        % 點數
fs = 8000;                      % 取樣頻率
freqStep = fs/N;              % 頻域的頻率的解析度
f = 10*freqStep;                % 正弦波的頻率,恰是 freqStep 的整數倍
time = (0:N-1)/fs;                % 時域的時間刻度
y = cos(2*pi*f*time);           % Signal to analyze
Y = fft(y);                     % Spectrum
Y = fftshift(Y);                % 將頻率軸的零點置中

% Plot time data
subplot(3,1,1);
plot(time, y, '.-');
title('Sinusoidal signals');
xlabel('Time (seconds)'); ylabel('Amplitude');
axis tight


% Plot spectral magnitude
freq = freqStep*(-N/2:N/2-1);   % 頻域的頻率刻度
subplot(3,1,2);
plot(freq, abs(Y), '.-b'); grid on
xlabel('Frequency)'); 
ylabel('Magnitude (Linear)');

% Plot phase
subplot(3,1,3);
plot(freq, angle(Y), '.-b'); grid on
xlabel('Frequency)'); 
ylabel('Phase (Radian)');

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有