modulate delivers asynchronous result
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Pulse width modulation (PWM) in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



