Help with Plotting a Pulse Train as function of time in MATLAB
Show older comments
Hi, the problem statement is listed below I have the values for f,wavelength,duty cycle, amplitude, etc. i would just need to plot the pulse train (from fourier series) as a function of time at the values of x=0 and x=5000. the problem is I have no idea how to do this in MATLAB. nor what it means by function of time, since there's no maximum t value. I tried this in excel but i was even more clueless. i would appreciate any help, thanks.
Answers (2)
Youssef Khmou
on 4 Sep 2013
Start from this version :
f0=1e+6; % 1MHz
Fs=3e+6;
Tf=0.001; % 1 millisecond
t=0:1/Fs:Tf-1/Fs;
td=0.1; % duty cycle
A0=10; % 10 Volts
F=0;
N=1000; % Number of points
for n=1:N
F=F+(1/n)*cos(n*2*pi*f0*t).*sin(n*pi*td);
end
F=F*(2*A0/pi);
F=F+A0*td;
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!