modulate delivers asynchronous result
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Pulse width modulation (PWM)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



