info
Characteristic information about coarse frequency compensator
Description
returns characteristic information for the specified coarse frequency compensator.infostruct
= info(coarseFreqComp
)
Examples
Compensate for Frequency Offset in QPSK Signal
Compensate for a 4 kHz frequency offset imposed on a noisy QPSK signal.
Set up the example parameters.
nSym = 2048; % Number of input symbols sps = 4; % Samples per symbol nSamp = nSym*sps; % Number of samples fs = 80000; % Sampling frequency (Hz)
Create a square root raised cosine transmit filter.
txfilter = comm.RaisedCosineTransmitFilter( ... RolloffFactor=0.2, ... FilterSpanInSymbols=8, ... OutputSamplesPerSymbol=sps);
Create a phase frequency offset object to introduce the 4 kHz frequency offset.
freqOffset = comm.PhaseFrequencyOffset( ... FrequencyOffset=-4000, ... SampleRate=fs);
Create a coarse frequency compensator object to compensate for the offset.
freqComp = comm.CoarseFrequencyCompensator( ... Modulation="qpsk", ... SampleRate=fs, ... FrequencyResolution=1);
Generate QPSK symbols, filter the modulated data, pass the signal through an AWGN channel, and apply the frequency offset.
data = randi([0 3],nSym,1);
modData = pskmod(data,4,pi/4);
txSig = txfilter(modData);
rxSig = awgn(txSig,20,"measured");
offsetData = freqOffset(rxSig);
Compensate for the frequency offset using the coarse frequency compensator. For high frequency offsets, applying coarse frequency compensation prior to receive filtering is beneficial because filtering suppresses energy in the useful spectrum.
[compensatedData,estFreqOffset] = freqComp(offsetData);
Display the estimate of the frequency offset.
estFreqOffset
estFreqOffset = -3.9999e+03
Return information about the coarse frequency compensator System object. To obtain the FFT length, you must call the coarse frequency compensator System object prior to calling the info
object function.
freqCompInfo = info(freqComp)
freqCompInfo = struct with fields:
FFTLength: 131072
Algorithm: 'FFT-based'
Create a spectrum analyzer object and plot the offset and compensated spectra. Verify that the compensated signal has a center frequency at 0 Hz and that the offset signal has a center frequency at -4 kHz.
sa = spectrumAnalyzer( ... SampleRate=fs, ... ShowLegend=true, ... ChannelNames=["Offset Signal","Compensated Signal"]); sa([offsetData compensatedData])
Input Arguments
coarseFreqComp
— Coarse frequency compensator
CoarseFrequencyCompensator
System object™
Coarse frequency compensator specified as a comm.CoarseFrequencyCompensator
System object.
Output Arguments
infostruct
— Characteristic information about coarse frequency compensator
structure
Characteristic information about coarse frequency compensator, returned as a structure containing these fields.
FFTLength
— Number of FFT samples
scalar
Number of fast Fourier transform (FFT) samples, returned as a scalar. Appears
only when Algorithm
is FFT-based
.
Dependency
To enable this field, set the Algorithm
property of the
coarseFreqComp
input to
'FFT-based'
.
Algorithm
— Algorithm used to estimate frequency offset
'FFT-based'
| 'Correlation-based'
Algorithm used to estimate frequency offset, returned as
'FFT-based'
or 'Correlation-based'
. This
value matches the Algorithm
property of the
coarseFreqComp
input.
MaxLag
— Number of samples used to estimate the autocorrelation
positive integer
Number of samples used to estimate the autocorrelation, returned as a positive integer.
Dependency
To enable this field, set the Algorithm
property of the
coarseFreqComp
input to
'Correlation-based'
.
Data Types: struct
Version History
Introduced in R2015b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)