Main Content

Set Radio Sample Times

Block Radio Sample Times

The RTL-SDR radio sample time in an RTL-SDR Receiver block is the Simulink® sample time. The RTL-SDR radio sample time is not related to the sample time of the data that the board receives over the air. However, setting the sample time of the block to match the hardware sample time is good practice.

To set the sample rate, specify the Sampling rate (Hz) parameter of the block. The sample time specified by the RTL-SDR Receiver block is the time interval between successive output samples of the block. If you turn on the sample time colors of the model (Format > Sample Time Display > All), the sample time value at the output of the RTL-SDR Receiver block corresponds to the Simulink sample time. This sample time is the time interval between block outputs. The Simulink sample time is equal to the sample time specified in the block mask times the vector length at the output of the block.

System Object Sample Times

The RTL-SDR receiver System object™ sample rate is the rate between successive samples of MATLAB® data (specifically the time interval between successive output samples of the System object). This sample time is not related to the sample time of the data that the board receives over the air. However, setting the System object sample time to match the hardware sample time is a good practice.

To set the sample time of a System object to match the RTL-SDR radio sample time, follow these steps.

  1. Identify the current sample rate that is associated with the comm.SDRRTLReceiver System object by viewing its SampleRate property. For this example, create a default RTL-SDR receiver System object, displaying its property values. The default sample rate is 250,000 Hz.

    radio = comm.SDRRTLReceiver
    radio = 
     comm.SDRRTLReceiver with properties:
     
               RadioAddress: '0'
            CenterFrequency: 102500000
             EnableTunerAGC: true
                 SampleRate: 250000
             OutputDataType: 'int16'
            SamplesPerFrame: 1024
        FrequencyCorrection: 0
            EnableBurstMode: false
  2. Set the sample rate by setting the SampleRate property.

    radio.SampleRate = 200000;
    radio = 
     comm.SDRRTLReceiver with properties:
     
               RadioAddress: '0'
            CenterFrequency: 102500000
             EnableTunerAGC: true
                 SampleRate: 200000
             OutputDataType: 'int16'
            SamplesPerFrame: 1024
        FrequencyCorrection: 0
            EnableBurstMode: false

See Also

Blocks

Objects