modulate delivers asynchronous result
Ältere Kommentare anzeigen
Hi,
I want to use modulate to get a pulse width modulated signal for a 200Hz signal at a sample rate of 8kHz.
this is my code
f_el=200;
fsw=8000;
stop_time=1/f_el;
step_fundamental=1/f_el/200;
t_fundamental=0:step_fundamental:stop_time;
sine=0.5*(sin(2*pi*f_el*t_fundamental)+1);
%% simple pwm modulation
y=modulate(sine,f_el,fsw,'pwm');
step_sw=stop_time/length(y);
t_sw=stop_time/length(y):step_sw:stop_time;
%
figure
hold on
plot(t_fundamental,sine,'linewidth',2)
plot(t_sw,y)
% plot(t_sw,1-y)
However, the result is an asynchronous pwm pattern with a larger area of "1" than "0".
Do you know why and can help me?
Thanks in advance
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Pulse width modulation (PWM) finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



