JonnyMcK
Electrical
- Jul 11, 2005
- 12
Hi everyone.
I am using Matlab to modulate a wave file using pulse position modulation (ppm) and I'm having a few problems.
When I try to use a low carrier frequency I get an error message saying Matlab is out of memory. (It works if the carrier frequency is, say 10000Hz, the wave file sample rate is 22050Hz). I don't know if this is because of a mistake on my part or whether my (quite sluggish) pc isn't up to the task.
I've also noticed that if I change the "OPT" setting (the length of each pulse) to anything lower than 0.5 the modulation fails completely and returns a flat line of 0. I don't understand why this should be the case.
Anyone have any ideas what is going wrong?
My code is:
y = wavread('sample.wav'); %Read sample
y = (y/2)+0.5; %Re-scale for ppm modulation
fs = 22050; %Sample rate
fc = 10000; %Carrier frequency
t = 0:1/fs:sample duration;
x = modulate(y,fc,fs,'ppm',0.5); %where 0.5 is the Opt setting
Thanks.
I am using Matlab to modulate a wave file using pulse position modulation (ppm) and I'm having a few problems.
When I try to use a low carrier frequency I get an error message saying Matlab is out of memory. (It works if the carrier frequency is, say 10000Hz, the wave file sample rate is 22050Hz). I don't know if this is because of a mistake on my part or whether my (quite sluggish) pc isn't up to the task.
I've also noticed that if I change the "OPT" setting (the length of each pulse) to anything lower than 0.5 the modulation fails completely and returns a flat line of 0. I don't understand why this should be the case.
Anyone have any ideas what is going wrong?
My code is:
y = wavread('sample.wav'); %Read sample
y = (y/2)+0.5; %Re-scale for ppm modulation
fs = 22050; %Sample rate
fc = 10000; %Carrier frequency
t = 0:1/fs:sample duration;
x = modulate(y,fc,fs,'ppm',0.5); %where 0.5 is the Opt setting
Thanks.