Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Drawing waveforms using Matlab
Drawing waveforms using Matlab

N=1024;

fs=1024;

t=0:1/fs:(N-1)/fs;

< p>x=sin(200*pi*t);

%original waveform

figure

plot(t,x)%%%waveform

p>

set(gca,'xlim',[0,0.2],'ylim',[-1.3,1.3])

title('Original waveform')

< p>%Spectrum analysis

a=fft(x);

a=abs(a)*2/N;

f=0:fs/ N:(N-1)*fs/N;

figure

plot(f,a)

title('spectrum chart')

Time domain diagram after % inverse transformation

b=ifft(a)*N/2;

figure

plot(t,b )

set(gca,'xlim',[0,0.2],'ylim',[-1.3,1.3])

title('Waveform after inverse transformation')< /p>