Bluetooth LE IQ samples Coherency and Dynamic Range Tests
This example shows you how to perform Bluetooth® low energy (LE) radio frequency (RF) physical layer (PHY) receiver tests specific to in-phase quadrature samples coherency (IQC) and IQ samples dynamic range (IQDR) by using Bluetooth® Toolbox. The tests compute relative phase, reference phase deviation, and amplitudes of IQ samples at each antenna in an antenna array. This example also verifies whether these test measurement values are within the limits specified by the Bluetooth RF-PHY Test Specification [ 3 ].
Objectives of Bluetooth RF-PHY Tests
The Bluetooth RF-PHY Test Specification [ 3 ] defined by the Bluetooth Special Interest Group (SIG) includes RF-PHY tests for transmitter and receiver. The objectives of these RF-PHY tests are to:
Ensure interoperability between all Bluetooth devices
Ensure a basic level of system performance for all Bluetooth products
Each test case has a specific test procedure and an expected outcome, which must be met by the implementation under test (IUT).
IQC and IQDR Tests
The Bluetooth Core Specification 5.1 [ 2 ] introduced angle of arrival (AoA) and angle of departure (AoD) direction finding features. For more information about direction finding services in Bluetooth LE, see Bluetooth LE Positioning by Using Direction Finding and Bluetooth Location and Direction Finding. The Bluetooth RF-PHY Test Specification [ 3 ] specifies the tests for direction finding transmitted waveforms with constant tone extension (CTE). This example includes AoA and AoD receiver tests specific to IQC and IQDR.
IQ sample coherency: This test verifies the relative phase and reference phase deviation values derived from the I and Q values sampled on AoA or AoD receiver.
IQ sample dynamic range: This test verifies the I and Q values sampled on AoA or AoD receiver by varying the dynamic range of the CTE.
This table shows various RF-PHY AoA and AoD receiver tests performed in this example.
Configure Simulation Parameters
Specify the receiver test ID, array size, samples per symbol, and element spacing between the antenna elements.
rxTestID ="RF-PHY/RCV/IQC/BV-05-C"; % Receiver test case ID arraySize =
2; % Array size, must be 4 or [2 2] for AoD receiver tests and 2,3,4,[2 2] % for AoA receiver tests sps = 8; % Samples per symbol elementSpacing = 0.5; % Normalized spacing between the antenna elements with respect to wavelength
Generate RF-PHY Test Parameters
Generate test parameters based on the receiver test ID, array size, and samples per symbol. To generate the PHY mode, CTE type, slot duration, test switching pattern, number of packets to transmit and input power to the receiver, use the helperBLEIQCIQDRTestConfig function. Create and configure comm.ThermalNoise
System object™ to add thermal noise.
[phyMode,cteType,slotDuration,switchingPattern,numPackets,rxPower] = ... helperBLEIQCIQDRTestConfig(rxTestID,arraySize,sps); % The CTEInfo field position is same for the LE test packet and data % packet, so consider dfPacketType as ConnectionCTE for CTE based RF-PHY % tests dfPacketType = 'ConnectionCTE'; % Create and configure Bluetooth LE angle estimation configuration object cfg = bleAngleEstimateConfig('ArraySize',arraySize,'SlotDuration',slotDuration, ... 'SwitchingPattern',switchingPattern,'ElementSpacing',elementSpacing); numElements = getNumElements(cfg); % Number of elements in the array % Create a thermal noise System object NF = 12; % Noise figure (dB) symRate = 1e6 + 1e6*(strcmp(phyMode,'LE2M')); % Symbol rate in Hz based on PHY transmission mode sampleRate = symRate*sps; % Sampling rate in Hz thNoise = comm.ThermalNoise('NoiseMethod','Noise figure', ... 'SampleRate',sampleRate, ... 'NoiseFigure',NF);
Simulate IQ Coherency or Dynamic Range Tests
To simulate the IQC and IQDR tests, perform these steps.
Generate Bluetooth LE test packet waveform.
Perform waveform steering and antenna switching.
Add thermal noise.
Perform demodulation, decoding, and IQ sampling on the noisy waveform.
Perform IQC and IQDR test measurements.
Based on the receiver test, the helperBLEIQCIQDRTest function returns these values.
% Initialize the number of outputs based on the receiver test ID numOutputs = 2 + 4*any(strcmp(rxTestID,{'RF-PHY/RCV/IQC/BV-01-C','RF-PHY/RCV/IQC/BV-02-C', ... 'RF-PHY/RCV/IQC/BV-03-C','RF-PHY/RCV/IQC/BV-04-C','RF-PHY/RCV/IQC/BV-05-C', ... 'RF-PHY/RCV/IQC/BV-06-C'})); [iqcIQDROutputs,iqcIQDROutputsConc] = deal(cell(1,numOutputs)); % Generate Bluetooth LE test waveform bleTestWaveformConfig = bluetoothTestWaveformConfig; bleTestWaveformConfig.Mode = phyMode; bleTestWaveformConfig.PacketType = dfPacketType; bleTestWaveformConfig.PayloadType = randsrc(1,1,1:7); % Payload type can be any value as the payload length is zero bleTestWaveformConfig.PayloadLength = 0; % Empty payload for the considered receiver test IDs bleTestWaveformConfig.CTELength = 20; bleTestWaveformConfig.SamplesPerSymbol = sps; bleWaveform = bluetoothTestWaveform(bleTestWaveformConfig); % Loop over the number of packets for i = 1:numPackets % Generate random angle(s) between -90 to 90 degrees angles = randsrc(2,1,-90:90); % Perform steering and switching between the antennas dfWaveform = helperBLESteerSwitchAntenna(bleWaveform,angles,... phyMode,sps,dfPacketType,bleTestWaveformConfig.PayloadLength,cfg); % Attenuate the waveform according to the given received power dfWaveformAtt = dfWaveform.*10.^(rxPower/20); % Add thermal noise to the waveform noisyWaveform = thNoise(dfWaveformAtt); % Pass the noisy waveform to the Bluetooth LE ideal receiver and get the IQ % samples [~,~,iqSamples] = bleIdealReceiver(noisyWaveform,'Mode',phyMode, ... 'SamplesPerSymbol',sps,'DFPacketType',dfPacketType, ... 'SlotDuration',slotDuration,'WhitenStatus','Off'); % Perform IQC and IQDR test measurements based on the receiver test ID [iqcIQDROutputs{:}] = helperBLEIQCIQDRTest(rxTestID,iqSamples,numElements); % Concatenate the outputs over the number of packets for j = 1:numOutputs iqcIQDROutputsConc{j} = [iqcIQDROutputsConc{j}; iqcIQDROutputs{j}]; end end
Test Verdict
Verify whether the IQC and IQDR test measurements are within the specified limits and display the test verdict.
if any(strcmp(rxTestID,{'RF-PHY/RCV/IQC/BV-01-C','RF-PHY/RCV/IQC/BV-02-C', ... 'RF-PHY/RCV/IQC/BV-03-C','RF-PHY/RCV/IQC/BV-04-C', ... 'RF-PHY/RCV/IQC/BV-05-C','RF-PHY/RCV/IQC/BV-06-C'})) % IQC test % For each nonreference antenna, Am, where m is in the range [0, number % of antenna elements-1], used in the switching pattern, the results of % the summations in the formulae for MRP(m) and MRPD must be nonzero disp ('Expected summations in the formulae for MRP(m) and MRPD must be non-zero.'); if all(all(iqcIQDROutputsConc{2}~=0)) && all(iqcIQDROutputsConc{5}~=0) disp('Result: Pass'); else disp('Result: Fail'); end % For each nonreference antenna, Am, used in the switching pattern, 95% % of the values, v, in the set must be -0.52<=principal(v-MRP(m))<=0.52 mrpRep = kron(iqcIQDROutputsConc{3},ones(length(iqcIQDROutputsConc{1})/length(iqcIQDROutputsConc{3}),1)); subMRP = iqcIQDROutputsConc{1} - mrpRep; if size(subMRP,2) == 3 && any(strcmp(rxTestID,{'RF-PHY/RCV/IQC/BV-01-C',... 'RF-PHY/RCV/IQC/BV-03-C','RF-PHY/RCV/IQC/BV-05-C','RF-PHY/RCV/IQC/BV-06-C'})) subMRP(3:3:end,3) = 0; end subMRPPrincipal = helperBLEPrincipalAngle(subMRP); subMRPRange = sum(subMRPPrincipal<=0.52 & subMRPPrincipal>=-0.52); disp ('Expected 95% of the values v in the set RP(m) must meet -0.52<=principal(v-MRP(m))<=0.52.'); if all(subMRPRange>0.95*length(subMRPPrincipal)) disp('Result: Pass'); else disp('Result: Fail'); end % MRPD must be in the range -1.125 to 1.125 disp ('Expected MRPD in the range [-1.125, 1.125] radians.'); if all(iqcIQDROutputsConc{6}<=1.125) && all(iqcIQDROutputsConc{6}>=-1.125) disp('Result: Pass'); else disp('Result: Fail'); end else % IQDR test % The mean of amplitudes of IQ samples measured at each antenna follows % the equation mean(ANT3)<mean(ANT2)<mean(ANT0)<mean(ANT1) meanA1 = mean(iqcIQDROutputsConc{1}); meanA = mean(iqcIQDROutputsConc{2}); if length(meanA) == 1 disp('The mean of amplitudes must follow mean(ANT0)<mean(ANT1).'); conditionCheck = meanA1<meanA(1); elseif length(meanA) == 2 disp('The mean of amplitudes must follow mean(ANT2)<mean(ANT0)<mean(ANT1).'); conditionCheck = meanA1<meanA(1) && meanA1>meanA(2); else disp('The mean of amplitudes must follow mean(ANT3)<mean(ANT2)<mean(ANT0)<mean(ANT1).'); conditionCheck = meanA1<meanA(1) && meanA1>meanA(2) && meanA(3)<meanA(2); end if conditionCheck disp('Result: Pass'); else disp('Result: Fail'); end end
Expected summations in the formulae for MRP(m) and MRPD must be non-zero.
Result: Pass
Expected 95% of the values v in the set RP(m) must meet -0.52<=principal(v-MRP(m))<=0.52.
Result: Pass
Expected MRPD in the range [-1.125, 1.125] radians.
Result: Pass
This example demonstrates the Bluetooth LE receiver test measurements specific to IQC and IQDR test measurements. The simulation results verify that the computed test measurement values are within the limits specified by the Bluetooth RF-PHY Test Specifications [ 3 ].
Appendix
The example uses these helpers:
helperBLEIQCIQDRTestConfig: Configure test parameters specific to IQC and IQDR test measurements
helperBLESteerSwitchAntenna: Perform antenna steering and switching
helperBLESwitchAntenna: Perform antenna switching
helperBLEPrincipalAngle: Compute principal angle in radians
helperBLEIQCIQDRTest: Perform IQC and IQDR test measurements
Selected Bibliography
Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed November 22, 2021. https://www.bluetooth.com
Bluetooth Special Interest Group (SIG). "Core System Package [Low Energy Controller Volume]". Bluetooth Core Specification. Version 5.3, Volume 6, https://www.bluetooth.com
Bluetooth Special Interest Group (SIG). “Bluetooth RF-PHY Test Specification”, RF-PHY.TS.5.1.0, Section 4.5. https://www.bluetooth.com