matlab program drawing style

1 回表示 (過去 30 日間)
zhiying
zhiying 2024 年 3 月 7 日
コメント済み: zhiying 2024 年 4 月 8 日
Why the following matlab program can not run the right picture inside the complete waveform, only the right picture waveform half, any elder brother know
clc;clear;
x=load('d1-1.txt');%加载数据
y=load('d1-2.txt');
fs=1e6;
T=1./fs;
L=32768;
t=(0:L-1)*T;
d1=fft(x);d2=fft(y);
D=d1.*conj(d2);
E=abs(D);F=1./E;
%N=length(F);G=F(1:fix(N/2));
H=ifft(F);
figure;plot(t,H);
  1 件のコメント
Mitchell Thurston
Mitchell Thurston 2024 年 3 月 29 日
I'm not sure what you're asking exactly, but in your plot(t,H), the variable t is entirely positive.

サインインしてコメントする。

回答 (1 件)

Steven Lord
Steven Lord 2024 年 3 月 29 日
Note the scale of the Y axis in your plot. Around t = 0 and t = 0.033 the value of D must get very small in magnitude, leading to 1./E being (relatively speaking) very large. That leads to the Y limits being on the order of 100 rather than on the order of 0.1.
If you were to set the Y axis limits of your plot with the ylim function to the same limits as in your pictures, it might look more like them.
  1 件のコメント
zhiying
zhiying 2024 年 4 月 8 日
Y axis is actually not very meaningful for this research, X axis can only be half generated by the above procedure, and the half generated X axis is not symmetrical with the half not generated, so how to draw the negative half axis of X that is not generated? I attached a signal file to this question, could you please try? Help to have a look, thank you!

サインインしてコメントする。

タグ

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by