Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Set parameters continuous signals
- fsc = 2500; %%sampling frequency in hz
- durc = 2; %%sampling duration in seconds
- tc = linspace(0,durc,durc*fsc);
- %% Sinusoids continuous
- x1c = 2*cos(2*pi*200*tc + pi/3);
- x2c = 5*cos(2*pi*350*tc+pi/2);
- x3c = 5*cos(2*pi*600*tc+pi/4);
- xtc = x1c + x2c + x3c;
- %% Set parameters discrete signals
- fsn = 1000; %%sampling frequency in hz
- durd = 2; %%sampling duration in seconds
- tsn = 1/fsn;
- tn = linspace(0,durd,durd*fsn);
- %% Define parameters for the sinusoids
- freq1 = 200;
- theta1 = 1.26;
- phase1 = pi/3;
- acfreq1 = (theta1 * fsn) / (2*pi);
- freq2 = 350;
- theta2 = 2.20;
- phase2 = pi/2;
- acfreq2 = (theta2 * fsn) / (2*pi);
- freq3 = 600;
- theta3 = -2.51;
- phase3 = -1 * pi/4;
- acfreq3 = (theta3 * fsn) / (2*pi);
- %% Sinusoids discrete
- x1d = 2*cos(2*pi*acfreq1*tn + phase1);
- x2d = 5*cos(2*pi*acfreq2*tn + phase2);
- x3d = 5*cos(2*pi*acfreq3*tn + phase3);
- xnd = x1d + x2d + x3d;
- subplot(211)
- plot(tn*tsn,xnd)
- subplot(212)
- plot(tc,xtc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement