Error in the output of dsp.SpectrumAnalyzer in matlab R2016a
1 view (last 30 days)
Show older comments
Array formation and parentheses-style indexing with objects of class 'dsp.SpectrumAnalyzer' is not allowed. Use objects of class 'dsp.SpectrumAnalyzer' only as scalars or use a cell array.
How to clear this error? I have attached the code. Please help me with this.
hset = 'H-Set1'; % H-Set number
modulation = 'QPSK'; % Modulation scheme
preconfigParams = umtsDownlinkReferenceChannels(hset,modulation); % Get H-Set parameters
frcWaveform = umtsDownlinkWaveformGenerator(preconfigParams); % Generate H-Set waveform
% H-Set parameter structure definition from scratch
% General settings
downlinkParams.TotFrames = 1; % Number of frames to be generated
downlinkParams.PrimaryScramblingCode = 0; % Primary scrambling code
downlinkParams.FilterType = 'RRC'; % Enable the RRC filter
downlinkParams.OversamplingRatio = 4; % Oversampling set to 4
downlinkParams.NormalizedPower = 'Off'; % Power normalization disabled
% Define Downlink Dedicated Physical Channel (DPCH)
downlinkParams.DPCH.Enable = 'On'; % Enable DPCH
downlinkParams.DPCH.SlotFormat = 11; % DPCH slot format
downlinkParams.DPCH.SpreadingCode = 6; % DPCH spreading code
downlinkParams.DPCH.NMulticodes = 1; % Number of DPCH
downlinkParams.DPCH.SecondaryScramblingCode = 1; % Secondary scrambling code
downlinkParams.DPCH.TimingOffset = 0; % Timing Offset
downlinkParams.DPCH.Power = 0; % Power in dB
downlinkParams.DPCH.TPCData = 0; % TPC value
downlinkParams.DPCH.TFCI = 0; % TFCI value
downlinkParams.DPCH.DataSource = 'CCTrCH'; % DPCH data source is CCTrCH
% DPCH carries the Coded Composite Transport Channel (CCTrCH) containing
% one or more transport channels. Since DPCH source is specified as CCTrCH,
% define the CCTrCH containing DTCH and DCCH transport channels
% Build DTCH definition
TrCH(1).Name = 'DTCH'; % Name of the transport channel
TrCH(1).CRC = '16'; % CRC type
TrCH(1).TTI = 20; % TTI in ms
TrCH(1).CodingType = 'conv3'; % The coding type and rate
TrCH(1).RMA = 256; % Rate matching attribute
TrCH(1).DataSource = 'PN9-ITU'; % Tr channel data source
TrCH(1).ActiveDynamicPart = 1; % Index to active dynamic part
TrCH(1).DynamicPart(1) = struct('BlockSize',244,'BlockSetSize',244); % 1x244 blocks
% Build DCCH definition
TrCH(2).Name = 'DCCH'; % Name of the transport channel
TrCH(2).CRC = '12'; % CRC type
TrCH(2).TTI = 40; % TTI in ms
TrCH(2).CodingType = 'conv3'; % The coding type and rate
TrCH(2).RMA = 256; % Rate matching attribute
TrCH(2).DataSource = 'PN9-ITU'; % Tr channel data source
TrCH(2).ActiveDynamicPart = 1; % Index to active dynamic part
TrCH(2).DynamicPart(1) = struct('BlockSize',100,'BlockSetSize',100); % 1x100 blocks
% Finalize CCTrCH structure array using the TrCH structures defined above
downlinkParams.DPCH.CCTrCH.Name = 'DCH'; % Name of the CCTrCH
downlinkParams.DPCH.CCTrCH.DTXPosition = 'fixed'; % DTX position
downlinkParams.DPCH.CCTrCH.TrCH = TrCH; % Assign DTCH/DCCH to CCTrCH
% Define P-CCPCH
downlinkParams.PCCPCH.Enable = 'On'; % Enable P-CCPCH
downlinkParams.PCCPCH.Power = 0; % Set power to be 0dB
downlinkParams.PCCPCH.DataSource = 'CCTrCH'; % P-CCPCH data source is CCTrCH
% P-CCPCH CCTrCH carries the BCH transport channel. Since P-CCPCH source is
% CCTrCH, define CCTrCH containing BCH
clear TrCH;
TrCH(1).Name = 'BCH'; % Name of the Tr channel
TrCH(1).CRC = '16'; % CRC type
TrCH(1).TTI = 20; % TTI in ms
TrCH(1).CodingType = 'conv2'; % The coding type and rate
TrCH(1).RMA = 256; % Rate matching attribute
TrCH(1).DataSource = 'PN9-ITU'; % Tr channel data source
TrCH(1).ActiveDynamicPart = 1; % Index to active dynamic part
TrCH(1).DynamicPart(1) = struct('BlockSize',246,'BlockSetSize',246); % 1x246 block
% Finalize CCTrCH structure array using the TrCH structure defined above
downlinkParams.PCCPCH.CCTrCH.Name = 'BCH'; % Name of the CCTrCH
downlinkParams.PCCPCH.CCTrCH.DTXPosition = 'fixed';% DTX position
downlinkParams.PCCPCH.CCTrCH.TrCH = TrCH; % Assign BCH to CCTrCH
% Define S-CCPCH, but this channel is not required for H-Set1 generation
downlinkParams.SCCPCH.Enable = 'Off'; % Disable S-CCPCH
downlinkParams.SCCPCH.SlotFormat = 7; % Slot format number
downlinkParams.SCCPCH.SpreadingCode = 3; % S-CCPCH spreading code
downlinkParams.SCCPCH.SecondaryScramblingCode = 3; % Secondary scrambling code
downlinkParams.SCCPCH.TimingOffset = 0; % Timing Offset
downlinkParams.SCCPCH.Power = 0; % Power in dB
downlinkParams.SCCPCH.TFCI = 0; % TFCI value
downlinkParams.SCCPCH.DataSource = 'CCTrCH'; % S-CCPCH data source is CCTrCH
% S-CCPCH CCTrCH can carry PCH and FACH transport channels. Since S-CCPCH
% source is CCTrCH, define CCTrCH containing PCH and FACH
% Build PCH definition
TrCH(1).Name = 'PCH'; % Name of the Tr channel
TrCH(1).CRC = '16'; % CRC type
TrCH(1).TTI = 10; % TTI in ms
TrCH(1).CodingType = 'conv2'; % The coding type
TrCH(1).RMA = 256; % Rate matching attribute
TrCH(1).DataSource = 'PN9-ITU'; % Tr channel data source
TrCH(1).ActiveDynamicPart = 1; % Index to active dynamic part
TrCH(1).DynamicPart(1) = struct('BlockSize',64,'BlockSetSize',64); % 1x64 block
% Build FACH definition
TrCH(2).Name = 'FACH'; % Name of the Tr channel
TrCH(2).CRC = '16'; % CRC type
TrCH(2).TTI = 10; % TTI in ms
TrCH(2).CodingType = 'turbo'; % The coding type
TrCH(2).RMA = 256; % Rate matching attribute
TrCH(2).DataSource = 'PN9-ITU'; % Tr channel data source
TrCH(2).ActiveDynamicPart = 1; % Index to active dynamic part
TrCH(2).DynamicPart(1) = struct('BlockSize',360,'BlockSetSize',360); % 1x360 block
% Finalize CCTrCH using the above
downlinkParams.SCCPCH.CCTrCH.Name = ''; % Name of the CCTrCH
downlinkParams.SCCPCH.CCTrCH.DTXPosition = 'fixed';% DTX position
downlinkParams.SCCPCH.CCTrCH.TrCH = TrCH; % Assign PCH/FACH to CCTrCH
% Define P-CPICH
downlinkParams.PCPICH.Enable = 'On'; % Enable P-CPICH
downlinkParams.PCPICH.Power = 0; % Power in dB
% Define S-CPICH
downlinkParams.SCPICH.Enable = 'Off'; % Disable S-CPICH
downlinkParams.SCPICH.SpreadingCode = 4; % S-CPICH spreading code
downlinkParams.SCPICH.SecondaryScramblingCode = 4; % Secondary scrambling code
downlinkParams.SCPICH.Power = 0; % Power in dB
% Define P-SCH
downlinkParams.PSCH.Enable = 'On'; % Enable P-SCH
downlinkParams.PSCH.Power = 0; % Power in dB
% Define S-SCH
downlinkParams.SSCH.Enable = 'On'; % Enable S-SCH
downlinkParams.SSCH.Power = 0; % Power in dB
% Define PICH
downlinkParams.PICH.Enable = 'On'; % Enable PICH
downlinkParams.PICH.SpreadingCode = 16; % PICH spreading code
downlinkParams.PICH.TimingOffset = 0; % Timing offset
downlinkParams.PICH.Power = 0; % Power in dB
downlinkParams.PICH.DataSource = 'PagingData'; % PICH data source
downlinkParams.PICH.Np = 144; % Number of paging indicators
% Define HSDPA
downlinkParams.HSDPA.Enable = 'On'; % Enable HSDPA channels
downlinkParams.HSDPA.CodeGroup = 5; % Number of HS-PDSCHs
downlinkParams.HSDPA.CodeOffset = 1; % Code offset to first HS-PDSCH
downlinkParams.HSDPA.Modulation = 'QPSK'; % Modulation scheme
downlinkParams.HSDPA.VirtualBufferCapacity = 9600; % Buffer capacity
downlinkParams.HSDPA.InterTTIDistance = 3; % Inter TTI interval
downlinkParams.HSDPA.NHARQProcesses = 2; % Number of HARQ processes
downlinkParams.HSDPA.XrvSequence = [0 2 5 6]; % The XRV sequence
downlinkParams.HSDPA.UEId = 0; % UE Identity
downlinkParams.HSDPA.TransportBlockSizeId = 41; % The transport block size id
downlinkParams.HSDPA.HSSCCHSpreadingCode = 9; % Shared channel spreading code
downlinkParams.HSDPA.SecondaryScramblingCode = 6; % Secondary scrambling code
downlinkParams.HSDPA.HSPDSCHPower = 0; % HS-PDSCH power in dB
downlinkParams.HSDPA.HSSCCHPower = 0; % HS-SCCH power in dB
downlinkParams.HSDPA.DataSource = 'HSDSCH'; % Data source is HS-DSCH
% HS-DSCH transport channel definition
downlinkParams.HSDPA.HSDSCH.BlockSize = 3202; % The transport block size
downlinkParams.HSDPA.HSDSCH.DataSource = 'PN9-ITU';% HS-DSCH data source
% Define OCNS channels as defined in TS25.101 Table C.13
downlinkParams.OCNS.Enable = 'On'; % Enable OCNS channels
downlinkParams.OCNS.Power = 0; % OCNS power scaling in dB
downlinkParams.OCNS.OCNSType = 'H-Set_6DPCH'; % OCNS definition
% The structure defined above can be used to generate the waveform:
frcWaveform2 = umtsDownlinkWaveformGenerator(downlinkParams);
% For completeness we can see that the H-Set definition structures obtained
% by the above two parameterization approaches are identical
if(isequal(preconfigParams,downlinkParams))
disp(['H-Set1 configuration structures generated with and without using' ...
' umtsDownlinkReferenceChannels function are the same.']);
end
if(isequal(frcWaveform,frcWaveform2))
disp(['H-Set1 waveforms generated with and without using' ...
' umtsDownlinkReferenceChannels function are the same.']);
end
chiprate = 3.84e6; % Chip rate of the baseband waveform
spectrumPlot = dsp.SpectrumAnalyzer('SampleRate', chiprate*downlinkParams.OversamplingRatio);
spectrumPlot.Title = sprintf('Spectrum of Fixed Reference Channel (FRC) %s (%s) waveform', hset, modulation);
spectrumPlot.YLimits = [-100,40];
spectrumPlot(frcWaveform);
0 Comments
Answers (0)
See Also
Categories
Find more on UMTS Test and Measurement in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!