BLE Modulation Characteristics, Carrier Frequency Offset and Drift Test Measurements

This example shows how to measure Bluetooth® low energy (BLE) radio frequency physical layer (RF-PHY) transmitter tests specific to modulation characteristics, carrier frequency offset and drift using Communications Toolbox™ Library for the Bluetooth Protocol. This example also verifies whether the test measurements are within the specified limits as per the Bluetooth RF-PHY Test Specifications [ 1 ]

Objectives of BLE 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 BLE devices and to verify that a basic level of system performance is guaranteed for all BLE 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 covers transmitter tests relevant to modulation characteristics, carrier frequency offset and drift. The test case IDs and test purposes of the considered tests are as follows:

Transmitter Test Procedure

This block diagram summarizes the test procedure for transmitter tests relevant to modulation characteristics, carrier frequency offset and drift as specified in [ 1 ].

  • Generate test packets and pass them through bleWaveformGenerator to generate BLE test waveforms. The test waveforms required for different test IDs are:

  • Perform filtering as specified in the Bluetooth RF-PHY Test Specifications [ 1 ].

  • Add carrier frequency offset and drift for tests: RF-PHY/TRM/BV-06-C, RF-PHY/TRM/BV-12-C, RF-PHY/TRM/BV-14-C.

  • FM demodulate and measure test characteristics (frequency deviation or frequency drift).

  • Get the test verdict and display results.

Check for Support Package Installation

% Check if the 'Communications Toolbox Library for the Bluetooth Protocol'
% support package is installed or not.

Configure the Test Parameters

Initialize variables such as transmitter test ID, number of samples per symbol, payload length, and maximum carrier frequency drift.

txTestID = "RF-PHY/TRM/BV-09-C";    % Select one from these test cases:
                                    % RF-PHY/TRM/BV-09-C,RF-PHY/TRM/BV-11-C,
                                    % RF-PHY/TRM/BV-13-C,RF-PHY/TRM/BV-06-C,
                                    % RF-PHY/TRM/BV-12-C,RF-PHY/TRM/BV-14-C
payloadLen = 240;    % Payload length in bytes, must be in the range [37,255]
sps = 32;           % Number of samples per symbol, minimum of 32 samples per
                    % symbol as per the test specifications

% Frequency offset and drift for the tests: RF-PHY/TRM/BV-06-C,
maxFreqDrift = 5000;     % In Hz, must be in the range [-50e3,50e3]
initFreqOffset = 12000;   % In Hz, must be in the range [-100e3,100e3]

% The function, <matlab:edit(helperBLEModulationTestConfig.m')
% helperBLEModulationTestConfig.m>, can be configured to generate test
% parameters and to design a channel filter based on test case ID and samples
% per symbol.

[filtDesign,testParams] = helperBLEModulationTestConfig(txTestID,sps);

Generate Test Waveforms and Perform Filtering

Based on the test parameters, generate BLE test waveforms using the helper function helperBLETestWaveform. Thereafter, perform filtering on the generated test waveforms.

testWfmLen = (testParams.nonPDULen+testParams.codingFactor*payloadLen*testParams.bitsPerByte)*sps;
[testWfm,filtTestWfm] = deal(zeros(testParams.numOfTestSeqs,testWfmLen));
for wfmIdx = 1:testParams.numOfTestSeqs
    % Generate BLE test waveforms
    testWfm(wfmIdx,:) = helperBLETestWaveform(testParams.testSeqIds(wfmIdx),...
    % Perform filtering on the test waveforms
    filtTestWfm(wfmIdx,:) =  conv(testWfm(wfmIdx,:),...

Add Frequency Offset and Frequency Drift

Add frequency offset and frequency drift only for carrier frequency offset and drift tests: RF-PHY/TRM/BV-06-C, RF-PHY/TRM/BV-12-C, RF-PHY/TRM/BV-14-C.

if any(strcmp(txTestID,{'RF-PHY/TRM/BV-06-C','RF-PHY/TRM/BV-12-C','RF-PHY/TRM/BV-14-C'}))
    driftRate = maxFreqDrift/length(filtTestWfm);% Drift rate
    freqOffset = driftRate*(0:1:(length(filtTestWfm)-1))';% Frequency drift
    freqOffset = freqOffset+initFreqOffset;% Frequency offset and frequency drift
    pfo = comm.PhaseFrequencyOffset('FrequencyOffset',freqOffset,'SampleRate',testParams.sampleRate);
    wfmFreqOffset = pfo(filtTestWfm.');
    wfmFreqOffset = filtTestWfm;

FM Demodulate and Measure Test Characteristics

The function, helperBLEModulationTestMeasurements.m, performs FM demodulation and computes either frequency deviation, or frequency drift and initial frequency offset based on the provided test case ID.

[waveformDiffFreq,fOut1,fOut2] = helperBLEModulationTestMeasurements(wfmFreqOffset,txTestID,testParams);

Display Test Results

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


Test sequence: 00001111
    Measured average frequency deviation = 250 KHz
    Expected average frequency deviation = 247.5 kHz to 252.5 kHz
    Result: Pass
Test sequence: 10101010
    Measured average frequency deviation = 244.0016 kHz
    Expected average frequency deviation > 185 kHz
    Result: Pass
Ratio of deviations between two test sequences = 0.97601
Expected Ratio > 0.8 
    Result: Pass

This example demonstrated the BLE transmitter test measurements specific to modulation characteristics, carrier frequency offset and drift as per the Bluetooth RF-PHY Test Specifications [ 1 ].


The helpers used in this example are:

Selected Bibliography

  1. Section 4.4 of the Bluetooth RF-PHY Test Specification, Revision: RF-PHY.TS.5.1.0.

  2. Volume 6 of the Bluetooth Core Specification, Version 5.0 Core System Package [Low Energy Controller Volume].