傅里叶变换—信号观测时长和频率分辨率

傅里叶变换—信号观测时长和频率分辨率

前言

在这里插入图片描述


一、开始验证

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述


附录

MATLAB代码:

%% observe time T and frequency resolution verified
f1 = 1;    %the frequency of child signal 1 
f2 = 1.5;    %the frequency of child signal 2       Unit Hz
Fs = 50;   %sampling rate , Unit Hz
delta_t = 1/Fs;
% t = 0:delta_t:1-delta_t;      %the total time length is 1s,   contains 1 peroid of singal 1 and 1.5 peiod of singal 2
t = 0:delta_t:2-delta_t;      %the total time length is 2s,   contains 2 peroid of singal 1 and 3 peiod of singal 2
s1 = sin(2*pi*f1.*t);    %child signal 1
s2 = sin(2*pi*f2.*t);    %child signal 2
s  = s1 + s2;            %signal;
N = length(t);    %signal length and frequency axis length;
fft_s1 = fft(s1,N);       %fft of child signal 1
fft_s2 = fft(s2,N);       %fft of child signal 2
fft_s = fft(s,N);         %fft of signal
delta_f = Fs/N;       %resolution of frequncy
axis_f = (0:N-1)*delta_f;   %frequency axis
figure(1);
subplot(2,2,1)
plot(t,s1);             %plot signal 1
hold on
plot(t,s2,'-');         %plot signal 2
xlabel('time    s');
ylabel('signal');
title('time domain wave');
legend('child signal 1','child signal 2');
subplot(2,2,3)
plot(axis_f, abs(fft_s1));       %spectrum of signal 1;
hold on
plot(axis_f, abs(fft_s2),'-');       %spectrum of signal 2;
xlabel('frequency   Hz');
ylabel('fft result');
title('observation time 1s');
legend('child signal 1','child signal 2');


subplot(2,2,2)
plot(t,s);             %plot signal
xlabel('time    s');
ylabel('signal');
title('time domain wave');
subplot(2,2,4)
plot(axis_f, abs(fft_s));       %spectrum of signal 1;
xlabel('frequency   Hz');
ylabel('fft result');
title('observation time 1s');






% %separately observe the spectrum of signal that not full period
% f1 = 1;    %the frequency of child signal 1 
% f2 = 1.5;    %the frequency of child signal 2       Unit Hz
% Fs = 50;   %sampling rate , Unit Hz
% delta_t = 1/Fs;
% % t = 0:delta_t:1-delta_t;      %the total time length is 1s,   contains 1 peroid of singal 1 and 1.5 peiod of singal 2
% t = 0:delta_t:2-delta_t;      %the total time length is 2s,   contains 2 peroid of singal 1 and 3 peiod of singal 2
% s1 = sin(2*pi*f1.*t);    %child signal 1
% s2 = sin(2*pi*f2.*t);    %child signal 2
% s  = s1 + s2;            %signal;
% N = 500000;        %fft number in order to observe more detailed
% fft_s1 = fft(s1,N);       %fft of child signal 1
% fft_s2 = fft(s2,N);       %fft of child signal 2
% fft_s = fft(s,N);         %fft of signal
% delta_f = Fs/N;       %resolution of frequncy
% axis_f = (0:N-1)*delta_f;   %frequency axis
% figure(1);
% subplot(2,2,1)
% plot(t,s1);             %plot signal 1
% hold on
% plot(t,s2,'-');         %plot signal 2
% xlabel('time    s');
% ylabel('signal');
% title('time domain wave');
% legend('child signal 1','child signal 2');
% subplot(2,2,3)
% plot(axis_f, abs(fft_s1));       %spectrum of signal 1;
% hold on
% plot(axis_f, abs(fft_s2),'-');       %spectrum of signal 2;
% xlabel('frequency   Hz');
% ylabel('fft result');
% title('observation time 1s');
% legend('child signal 1','child signal 2');
% 
% 
% subplot(2,2,2)
% plot(t,s);             %plot signal
% xlabel('time    s');
% ylabel('signal');
% title('time domain wave');
% subplot(2,2,4)
% plot(axis_f, abs(fft_s));       %spectrum of signal 1;
% xlabel('frequency   Hz');
% ylabel('fft result');
% title('observation time 1s');
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值