validate
R2026bSyntax
Description
validate( returns an error message
when pilotcfg)pilotcfg defines invalid pilot configurations. For valid pilot
configurations no message is displayed.
To be valid, the pilot configuration must satisfy these conditions:
No pilot clusters overlap.
For every stream group and for every pilot symbol slice within that group, the corresponding matrix must be full rank and the pilot symbols are orthogonal.
Examples
This example steps through several validation issues by using the
validate object function to identify issues, and adjusts the
pilot configuration until a valid configuration is achieved.
Create an OFDM pilot configuration object and check validation.
pilotcfg = ofdmPilotConfig(FFTLength=64,NumGuardBandCarriers=[4;2], ... NumSymbols=16,NumTransmitStreams=4, ... StreamGroups={1,[2 3]},... PilotLocations={ofdmPilotGrid(1,1,1:3:63,[1 15])}, ... PilotSymbols={1}); validate(pilotcfg)
Error using ofdmPilotConfig/validate (line 209) Transmit stream 4 should belong to exactly one element of StreamGroups.
Reconfigure pilotcfg.StreamGroups.
pilotcfg.StreamGroups{1} = [1 4];
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 213) PilotLocations and StreamGroups must have the same number of elements.
Reconfigure pilotcfg.PilotLocations.
pilotcfg.PilotLocations{2} = pilotcfg.PilotLocations{1};
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 218)
size(PilotLocations{1},1) must be greater than or equal to ...
numel(StreamGroups{1}), but they are 1 and 2 respectively.Reconfigure pilotcfg.PilotLocations.
pilotcfg.PilotLocations{1} = ofdmPilotGrid([1 2],1,1:3:63,[1 15]);
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 218)
size(PilotLocations{2},1) must be greater than or equal to ...
numel(StreamGroups{2}), but they are 1 and 2 respectively.Reconfigure pilotcfg.PilotLocations.
pilotcfg.PilotLocations{2} = pilotcfg.PilotLocations{1};
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 223) Expected all subcarrier indices in PilotLocations to be ... an array with all of the values > 4.
Reconfigure pilotcfg.PilotLocations.
pilotcfg.PilotLocations{1} = ofdmPilotGrid([1 2],1,5:3:63,[1 15]);
pilotcfg.PilotLocations{2} = pilotcfg.PilotLocations{1};
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 223) Expected all subcarrier indices in PilotLocations to be ... an array with all of the values <= 62.
Reconfigure pilotcfg.PilotLocations.
pilotcfg.PilotLocations{1} = ofdmPilotGrid([1 2],1,5:3:61,[1 15]);
pilotcfg.PilotLocations{2} = pilotcfg.PilotLocations{1};
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 235) Duplicated pilot locations found at subcarrier 5 and symbol 1.
Reconfigure pilotcfg.PilotLocations.
pilotcfg.PilotLocations{1} = ofdmPilotGrid([1 2],1,5:3:61,[1 15]);
pilotcfg.PilotLocations{2} = ofdmPilotGrid([1 2],1,5:3:61,[2 16]);
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 254) PilotSymbols and StreamGroups must have the same number of elements.
Reconfigure pilotcfg.PilotSymbols.
pilotcfg.PilotSymbols{2} = pilotcfg.PilotSymbols{1};
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 261)
size(PilotSymbols{1},1) must be equal to size(PilotLocations{1},1), ...
but they are 1 and 2 respectively.Reconfigure pilotcfg.PilotSymbols.
pilotcfg.PilotSymbols{1} = ones(2,1);
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 262)
size(PilotSymbols{1},2) must be equal to numel(StreamGroups{1}), ...
but they are 1 and 2 respectively.Reconfigure pilotcfg.PilotSymbols.
pilotcfg.PilotSymbols{1} = ones(2,2);
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 263)
size(PilotSymbols{1},3) must be equal to size(PilotLocations{1},3), ...
but they are 1 and 38 respectively.Reconfigure pilotcfg.PilotSymbols.
pilotcfg.PilotSymbols{1} = ones(2,2,38);
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 261)
size(PilotSymbols{2},1) must be equal to size(PilotLocations{2},1), ...
but they are 1 and 2 respectively.Reconfigure pilotcfg.PilotSymbols.
pilotcfg.PilotSymbols{2} = ones(2,2,38);
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 269)
rank(PilotSymbols{1}(:,:,1)) must be equal to numel(StreamGroups{1}), ...
but they are 1 and 2 respectively.Reconfigure pilotcfg.PilotSymbols{1}. Orthogonal pilot
symbols should be carefully selected. For this example, a simple approach is used
to generate orthogonal pilot symbols.
pilotcfg.PilotSymbols{1} = randn(2,2,38,'like',1j);
validate(pilotcfg)Error using ofdmPilotConfig/validate (line 269)
rank(PilotSymbols{2}(:,:,1)) must be equal to numel(StreamGroups{2}), ...
but they are 1 and 2 respectively.Reconfigure pilotcfg.PilotSymbols{2}. Orthogonal pilot
symbols should be carefully selected. For this example, a simple approach is used
to generate orthogonal pilot symbols.
pilotcfg.PilotSymbols{2} = randn(2,2,38,'like',1j);
validate(pilotcfg)No message returned by validate means the configuration is
now valid.
pilotcfg
pilotcfg =
ofdmPilotConfig with properties:
FFTLength: 64 NumGuardBandCarriers: [2×1 double] ...
NumSymbols: 16 NumTransmitStreams: 4 StreamGroups: {[1 4] [2 3]} ...
PilotLocations: {[2×2×38 double] [2×2×38 double]} ...
PilotSymbols: {[2×2×38 double] [2×2×38 double]}A plot of the OFDM configuration would show that each stream group has 38 clusters of pilots, with 38 different colors.
% plot(pilotcfg) % view([90 -90]) % Subcarrier-symbol view
A more practical choice of pilot symbols based on Hadamard matrix with random QPSK phase shifts. Confirm all pilot symbols have unit power.
pilotcfg.PilotSymbols{1} = pskmod(randi([0 3],2,1,38),4,pi/4) .* hadamard(2);
pilotcfg.PilotSymbols{2} = pskmod(randi([0 3],2,1,38),4,pi/4) .* hadamard(2);
all(abs(pilotcfg.PilotSymbols{1}(:))==1) & all(abs(pilotcfg.PilotSymbols{2}(:))==1)ans = logical 1
Confirm the pilot configuration has different pilot symbols for two stream groups.
~isequal(pilotcfg.PilotSymbols{1},pilotcfg.PilotSymbols{2})ans = logical 1
Confirm pilot configuration is valid.
validate(pilotcfg) % pilot configuration is validInput Arguments
Pilot configuration object, specified as an ofdmPilotConfig object.
Tips
Before you pass an
ofdmPilotConfigobject toofdmChannelEstimate, call thevalidateobject function to confirm you have a valid pilot configuration.
Version History
Introduced in R2026a
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)