DSPRelated.com
Forums

PCM to PWM mapping in Matlab?

Started by hyla...@tcd.ie January 20, 2010
Hi,
I'm relatively new to matlab and am wondering how to go about mapping a PCM, pulse code modulated signal(8bit resolution)eg a .wav file, to a 1 bit Pulse Width Modulated Signal in Matlab.
I understand the theory behind PWM but i'm finding it quite difficult to implement this mapping in matlab.
Any help/code would be very much appreciated.
Thanks in advance,
Colin.
Hi Colin,

You can try 'modulate' function from the Signal Processing Toolbox with the 'pwm' option.
Below is a simple example:
x=(1:15)/16;
Fc=1;
Fs;
y=modulate(x,Fc,Fs,'pwm');
stem(y)

--
Alexander

Hi,
>I'm relatively new to matlab and am wondering how to go about mapping a PCM, pulse code modulated signal(8bit resolution)eg a .wav file, to a 1 bit Pulse Width Modulated Signal in Matlab.
>I understand the theory behind PWM but i'm finding it quite difficult to implement this mapping in matlab.
>Any help/code would be very much appreciated.
>Thanks in advance,
>Colin.