www.gusucode.com > phased 案例源码 matlab代码程序 > phased/MFSKStepOutputPerSweepExample.m

    %% MFSK Samples per Sweep
% Construct an MFSK waveform with a sample rate of 1 MHz and a sweep bandwidth
% of 0.1 MHz. Assume 52 steps with a step time of 400 microseconds. Set the
% frequency offset to 1 kHz. Find the number of samples returned when the
% |OutputFormat| property is set to return the samples for one sweep.

% Copyright 2015 The MathWorks, Inc.

fs = 1e6;
fsweep = 1e5;
tstep = 40e-4;
numsteps = 52;
foffset = 1000;
noutputsweeps = 1;
sMFSK = phased.MFSKWaveform('SampleRate',fs,...
    'SweepBandwidth',fsweep,...
    'StepTime',tstep,...
    'StepsPerSweep',numsteps,...
    'FrequencyOffset',foffset,...
    'OutputFormat','Sweeps',...
    'NumSweeps',noutputsweeps);
%%
% Call the |step| method to retrieve the samples for the four steps.
z = step(sMFSK);
%%
% Count the number of samples in a sweep.
samplespersweep = fs*tstep*numsteps;
disp(samplespersweep)

%%
% Verify that this value agrees with the number of samples returned by the |step|
% method.
disp(size(z))