【问题标题】:Plotting a triangular signal and finding its Fourier transformation in MATLAB在 MATLAB 中绘制三角信号并找到其傅里叶变换
【发布时间】:2017-04-06 21:45:43
【问题描述】:

我有以下 矩形 脉冲代码:

clear all
dt=.001;
t=[-25:dt:25];
x=(5/2)*(sign(t+10)-sign(t-10));
%subplot(2,2,1);
plot(t,x);
title('Rectangular pulse with width 10ms');
xlabel('time(ms)');
ylabel('Amplitude(V)');
axis([-25 25 0 6]);
>> y=fftshift(fft(x));  % moving the zero-frequency component to the center of the array
N=length(y);         %to take the frquecny axis of the hoarmonics.
n=-(N-1)/2:(N-1)/2;  %divide the frequency compone
f=sqrt(y.*conj(y)); % to take the amplitude of each hoarmony.

title('Rectangular pulse amplitude');
xlabel('frequency component(harmoney)');
ylabel('Amplitude of the harmoney');

plot(n,f);  
axis([-50 50 0 150000]); 
>> 
>> y=fftshift(fft(x));  % moving the zero-frequency component to the center of the array
N=length(y);         %to take the frquecny axis of the hoarmonics.
n=-(N-1)/2:(N-1)/2;  %divide the frequency compone
f=sqrt(y.*conj(y)); % to take the amplitude of each hoarmony.

title('Rectangular pulse amplitude');
xlabel('frequency component(harmoney)');
ylabel('Amplitude of the harmoney');

plot(n,f);  
axis([-50 50 0 150000]);

如何获得三角脉冲?

另外,上面的代码没有找到矩形信号的傅里叶变换。如何找到它?如何找到三角信号?是否可以在 MATLAB 中计算或手动评估?

【问题讨论】:

标签: matlab fft


【解决方案1】:

时间信号的长度应该足够长,以便在频域上获得适当的分辨率。

请尝试像这样更改您的时间段。

t=[-100:dt:100];

在三角信号方面,我认为brankz的评论是最好的。

在你的情况下,请像这样改变你的时间信号。

x=0.5*max(10-abs(t),0);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-05-12
    • 1970-01-01
    • 2021-03-04
    • 2014-11-02
    • 1970-01-01
    • 2016-04-29
    相关资源
    最近更新 更多