Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %TBeach
- clc
- clear all
- %xt=3*cos(2*pi*16*t)*sin(2*pi*2*t)
- fs=100; %samples per second
- dt=1/fs; %seconds per sample
- Stoptime=1; %seconds
- t=(0:dt:Stoptime-dt)'; %domain
- N=size(t,1); %array size
- xt=3*cos(2*pi*16*t).*sin(2*pi*2*t); %signal definition
- fft_xt=fftshift(fft(xt)); %fourier transform of signal
- dF=fs/N; %
- f=-fs/2:dF:fs/2-dF; %frequency domain
- figure;
- stem(f,abs(fft_xt)/N);
- xlabel('Frequency (Hz)');
- ylabel('Magnitude of X(f)');
- title('Spectrum of x(t)');
- grid;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement