Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Lab5 p 1
- sigBeat = makeBeatStruct(10, 1300, 13, 0, 0, 0, 5);
- %subplot(2,1, 1);
- plot(sigBeat.times, sigBeat.values);
- %subplot(2,1,2);
- %plotspec( xx, 8000, 1024 ), colorbar, grid on; %-- with negative frequencies
- function sigBeat = makeBeatStruct( B, fc, fdelta, phase1, phase2, startTime, endTime )
- %
- %--- Create a structure that has all the parameters defining a beat signal as used
- % in Equations (3) and (4)
- tt = startTime: 1/8000 : endTime;
- sigBeat.times = tt;
- sigBeat.values = B*cos(2*pi*fdelta.*tt + phase1).*cos(2*pi*fc.*tt + phase2);
- sigBeat.f1 = fdelta+fc;
- sigBeat.f2 = fdelta-fc;
- sigBeat.X1 = (B/2)*(phase1+phase2);
- sigBeat.X2 = (B/2)*(phase1-phase2);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement