Main Content

Bluetooth LE Modulation Characteristics, Carrier Frequency Offset and Drift Tests

This example shows how to perform Bluetooth® low energy (LE) radio frequency (RF) physical layer (PHY) transmitter tests specific to modulation characteristics, carrier frequency offset, and drift using Bluetooth® Toolbox. The test measurements compute frequency deviation, carrier frequency offset, and drift values. This example also verifies whether these test measurement values are within the limits specified by the Bluetooth RF-PHY Test Specifications [ 1 ].

Objectives of LE RF-PHY Tests

The Bluetooth RF-PHY Test Specifications [ 1 ] defined by Bluetooth Special Interest Group (SIG) includes RF-PHY tests for both 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 specified test procedure and an expected outcome, which must be met by the implementation under test (IUT).

RF-PHY Transmitter Tests

The main aim of transmitter test measurements is to ensure that the transmitter characteristics are within the specified limits as specified in the test specifications [ 1 ]. This example includes transmitter tests relevant to modulation characteristics, carrier frequency offset, and drift. This table shows various RF-PHY transmitter tests performed in this example.

Capture1.PNG

Transmitter Test Procedure

This block diagram summarizes the test procedure for transmitter tests relevant to modulation characteristics, carrier frequency offset, and drift.

Generate Bluetooth LE test packets by using the bluetoothTestWaveform function. The test waveforms required for different test IDs are:

Capture2.PNG

Configure the Test Parameters

Specify the RF-PHY test configuration parameters by using the bluetoothRFPHYTestConfig object. The function,helperBLEModulationTestConfig.m, can be configured to generate test parameters.

testConfig = bluetoothRFPHYTestConfig;
testConfig.Test = "Modulation characteristics";
testConfig.Mode = "LE1M";
testConfig.PayloadLength =240;              % Payload length in bytes, must be in the range [37, 255]
pulseLength = 2;                            % Length of the frequency pulse shape in the range [1, 4]
modulationIndex =0.5;                      % Modulation index of GFSK in the range [0.45, 0.55]

% The CTE information field position is same for LE test packet and data packet.
% For CTE-based RF-PHY tests, set the packet type to 'ConnectionCTE'.
testConfig.PacketType = "Disabled"; 
if strcmp(testConfig.PacketType,'ConnectionCTE')
    testConfig.CTELength =13;                % CTE length in 8 microseconds units,
end                                                                % must be in the range [13,20]
testConfig.SamplesPerSymbol = 32;                                  % Number of samples per symbol, minimum of 32 samples
                                                                   % per symbol as per the test specifications
testConfig.InitialFrequencyOffset =23000;  % In Hz, must be in the range [-100e3,100e3]
testConfig.CarrierDrift =0;             % In Hz, must be in the range [-50e3,50e3]

% Generate test parameters
[testParams,wgParams] = helperBLEModulationTestConfig(testConfig); 
wgParams.PulseLength = pulseLength;
wgParams.ModulationIndex = modulationIndex;

Simulate Transmitter Tests

To simulate the transmitter tests, perform these steps:

  1. Generate Bluetooth LE test packet waveform by using the bluetoothTestWaveform function.

  2. Add frequency offset, which includes initial frequency offset, and drift to the waveform by using the comm.PhaseFrequencyOffset System object.

  3. Add thermal noise by using the comm.ThermalNoise System object.

  4. Perform filtering on the noisy waveform by using helperModulationTestFilterDesign helper function.

  5. Perform FM demodulation on the filtered waveform.

  6. Perform test measurement and display the pass verdict.

if strcmp(testConfig.PacketType,'ConnectionCTE')
  [~,testWfmSymLen] = bluetoothPacketDuration(testConfig.Mode,testConfig.PacketType,...
      testConfig.PayloadLength,testConfig.CTELength);
else
  [~,testWfmSymLen] = bluetoothPacketDuration(testConfig.Mode,testConfig.PacketType,...
      testConfig.PayloadLength);
end
testWfmLen = testWfmSymLen*testConfig.SamplesPerSymbol;
driftRate = testConfig.CarrierDrift/testWfmLen;% Drift rate
freqDrift = driftRate*(0:1:(testWfmLen-1))';% Frequency drift

% Frequency offset and frequency drift
freqOffset = testConfig.InitialFrequencyOffset + freqDrift; 

% Create a phase frequency offset System object
pfo = comm.PhaseFrequencyOffset('FrequencyOffset',freqOffset,...
    'SampleRate',testParams.sampleRate);
% Create a thermal noise System object

NF = 12; % Noise figure in dB
thNoise = comm.ThermalNoise('NoiseMethod','Noise figure',...
                            'SampleRate',testParams.sampleRate,...
                            'NoiseFigure',NF);
filtDesign = modulationTestFilter(testParams.phyMode,testParams.sampleRate);
filtTestWfm = zeros(testWfmLen,testParams.numOfTestSeqs);
for wfmIdx = 1:testParams.numOfTestSeqs
    % Generate Bluetooth LE test waveforms
    wgParams.PayloadType = testParams.testSeqIds(wfmIdx);
    testWfm = bluetoothTestWaveform(wgParams);
    wfmFreqOffset = pfo(testWfm);
    wfmChannel = thNoise(wfmFreqOffset);
    % Perform filtering
    filtTestWfm(:,wfmIdx) = conv(wfmChannel,filtDesign.Numerator.','same'); 
end

Perform frequency modulation by using the helperBLEModulationTestMeasurements.m helper function. Based on the test, the helperBLEModulationTestMeasurements.m helper function computes either frequency deviation, or frequency drift and initial frequency offset.

[waveformDiffFreq,fOut1,fOut2,fOut3] = helperBLEModulationTestMeasurements(filtTestWfm,...
    testConfig.TestID,testParams);

The helperBLEModulationTestVerdict.m helper function verifies whether the measurements are within the specified limits, and displays the verdict on the command window.

helperBLEModulationTestVerdict(waveformDiffFreq,testConfig.TestID,testParams,fOut1,...
    fOut2,fOut3)

Figure contains 2 axes objects. Axes object 1 with title Frequency Demodulated Waveform for Sequence: 11110000, xlabel Samples, ylabel Frequency (in Hz) contains 3 objects of type line. These objects represent FM Demodulated Waveform, Average Frequency Deviation, Sequence Center Frequency. Axes object 2 with title Frequency Demodulated Waveform for Sequence: 10101010, xlabel Samples, ylabel Frequency (in Hz) contains 3 objects of type line. These objects represent FM Demodulated Waveform, Average Frequency Deviation, Sequence Center Frequency.

Test sequence: 11110000
    Measured average frequency deviation = 250.0201 kHz
    Expected average frequency deviation = 225 kHz to 275 kHz
    Result: Pass
Test sequence: 10101010
    Expected 99.9% of all maximum frequency deviation > 185000 kHz
    Result: Pass
Ratio of frequency deviations between two test sequences = 0.83511
Expected Ratio > 0.8 
    Result: Pass

This example demonstrated the Bluetooth LE transmitter test measurements specific to modulation characteristics, carrier frequency offset and, drift. The simulation results verify that these computed test measurement values are within the limits specified by Bluetooth RF-PHY Test Specifications [ 1 ].

Appendix

The helpers used in this example are:

Selected Bibliography

  1. Bluetooth Special Interest Group (SIG). “Bluetooth RF-PHY Test Specification”, Revision: RF-PHY.TS.5.1.0, Section 4.4. 2018. https://www.bluetooth.com.

  2. Bluetooth Special Interest Group (SIG). "Bluetooth Core Specification". Version 5.3. https://www.bluetooth.com.

Local Functions

function Hd = modulationTestFilter(phyMode,Fsamp)
% Design FM demodulation filter
multFactor = 1;
if strcmp(phyMode,'LE2M')
    multFactor = 2;
end

Fpass = 550000*multFactor;           % Passband Frequency
Fstop = 2000000*multFactor;          % Stopband Frequency
Dpass = 0.028774368332;              % Passband Ripple
Dstop = 0.0063095734448;             % Stopband Attenuation
dens  = 20;                          % Density Factor

% Calculate the order from the parameters using FIRPMORD.
[N, Fo, Ao, W] = firpmord([Fpass, Fstop]/(Fsamp/2), [1 0], [Dpass, Dstop]);

% Calculate the coefficients using the FIRPM function.
b  = firpm(N, Fo, Ao, W, {dens});
Hd = dfilt.dffir(b);
end

See Also

Functions

Objects

Related Topics