|
- fs=12;
- N=2500;
- n=0:N-1;
- t1=0:1/fs:1;
- x1=t1;
- t2=1:1/fs:2;
- x2=2-t2;
- x=[x1,x2];
- t=[t1,t2];
- figure(1);
- plot(t,x);
- xlabel('t');
- ylabel('f(t)');
- title('f(t)= t(0≤t≤1);2-t(1≤t≤2) time domain waveform');
- grid;
- y=fft(x,N);
- y1=fftshift(y);
- mag=abs(y);
- mag1=abs(y1);
- f=n*fs/N;
- f1=n*fs/N-fs/2;
- figure(2);
- plot(f1,mag1);
- xlabel('Frequency');
- ylabel('Amplitude');
- title('f(t)= t(0≤t≤1);2-t(1≤t≤2) ferquency domain waveform ');
- grid;
- a=real(y1);
- b=imag(y1);
- figure(3);
- plot(f1,a);
- title('Real');
- grid;
- figure(4);
- plot(f1,b);
- title('Imaginary');
- grid;
- y2=hilbert(a);
- figure(5);
- plot(f1,y2);
复制代码 这是我找的别人的程序,你看是不是这个意思
|
|