How do I plot a signal over a duration of 1 second, with a = 200 and b = 0 for t<0.1 and a = 0 and b = 400 for t >=0.1
Show older comments
How do I produce a signal over a duration of 0.1 second at a sampling rate of 8kHz, with a = 1000 and b = 0 for t<0.05 and a = 0 and b = 1000 for t >=0.05
where the signal is x(t) = sin(2*pi*a*t) + sin(2*pi*b*t)
I have produced a similar signal prior to this, wherein a and b did not change value at certain points in time.
The similar signal:
%%Construct Signal
% f_1(t) = sin(2*pi*a*t)+sin(2*pi*b*t)
% at a sampling rate of 8kHz, for a duration of 0.1 seconds
% a= 500 Hz
% b= 1000 Hz
fs = 8000; % Sampling Rate
ts = 1/fs; % Sampling Period
t = linspace(0, 0.1, 1001);
t = t(1:end-1);
a= 500;
b= 1000;
f_1 = sin(2*pi*a*t)+sin(2*pi*b*t); % function f_1(t)
figure(1)
plot(t,f_1);
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!