Phased.LinearFMWaveform Function + For Loop
Show older comments
I am trying to generate a Phase.LinearFMWaveform, as a function of a set of some particular, varying parameters. To be specific, I would like the parameters PulseWidth, PRF (Pulse Repetition Frequency), and NumPulses. (These are specific arguments that Phase.LinearFMWaveform adhere to.) I would also like to vary the Amplitude.
Basically, with each iteration of the For loop, I would like a different Phase.LinearFMWaveform to generate.
SampRate_LFM = 1e6
SweepBW_LFM = 1e5
NumRepPulse_LFM = 1
MinPW_LFM = 40e-6
MaxPW_LFM = 60e-6
MinPRF_LFM = 5e3
MaxPRF_LFM = 10e3
MinAmp_LFM = 1
MaxAmp_LFM = 5
NumRepPulse = 4
NumPulse_LFM = 1
for k = 1: NumRepPulse_LFM
PW_LFM(:, k) = round((MinPW_LFM + (MaxPW_LFM - MinPW_LFM)*rand(1))/NumRepPulse, 6, 'decimals')*NumRepPulse % generate a set of varying PWs
PRF_LFM(:, k) = round(MinPRF_LFM + (MaxPRF_LFM - MinPRF_LFM)*rand(1)/NumRepPulse, 1, 'significant')*NumRepPulse % generate a set of varying PRFs
Amp_LFM(:, k) = round(MinAmp_LFM + (MaxAmp_LFM - MinAmp_LFM)*rand(1)/NumRepPulse, 1, 'significant')*NumRepPulse % generate a set of varying Amps
LFM = phased.LinearFMWaveform('SampleRate', SampRate_LFM, 'PulseWidth', PW_LFM(k), 'PRF', PRF_LFM(k), 'SweepBandwidth', SweepBW_LFM, 'NumPulses', NumPulse_LFM)
end
Answers (1)
Honglei Chen
on 28 Jun 2016
Your code runs just fine, could you elaborate what your question is? My guess is you want to see the signal itself? If so, you can just call the step() method after you created LFM, like
x = step(LFM)
HTH
Categories
Find more on Array Geometries and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!