Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ppm modulation - problems 1

Status
Not open for further replies.

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.
 
Replies continue below

Recommended for you

You gave the audio sample rate as 22.05 kHz. The help file for the modulate function says
"Fs must satisfy Fs > 2*Fc + BW"
The Fs is for the RF sample frequency, not the baseband audio. You need to pick what sample rate you want to run your ppm at and what carrier you want. You would need to pick a carrier above your Nyquist criteria, then you sample also has a Nyquist criteria above your carrier.
But you fundamental problem will be memory, so you might have to break up your audio file into single samples or into small vectorizable chunks and run them through a sequential simulation instead of in block mode.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor