Main Content

gsmFrame

Create GSM waveform

Description

gsmWaveform = gsmFrame(gsmCfg) creates a GSM waveform with one TDMA frame based on the input GSM configuration object. The encrypted bit field of the transmission data bursts is filled with random data. For more information, see GSM Frames, Time Slots, and Bursts.

example

gsmWaveform = gsmFrame(gsmCfg,numFrames) creates a GSM waveform, with numFrames identically configured TDMA frames. In each frame, the encrypted bit field of the transmission data bursts is filled with random data. For more information, see GSM Frames, Time Slots, and Bursts.

example

Examples

collapse all

Create a GSM uplink TDMA frame configuration object with default settings, and then create a GSM waveform containing one TDMA frame. GSM TDMA frames have eight time slots, each separated by a guard period of 8.25 symbols or about 30.46x10e-3 ms. Plot the GSM waveform.

Create a GSM uplink TDMA frame configuration object with default settings.

cfggsmul = gsmUplinkConfig
cfggsmul = 
  gsmUplinkConfig with properties:

           BurstType: [NB    NB    NB    NB    NB    NB    NB    NB]
    SamplesPerSymbol: 16
                 TSC: [0 1 2 3 4 5 6 7]
         Attenuation: [0 0 0 0 0 0 0 0]
         PulseLength: 4
            RiseTime: 2
           RiseDelay: 0
            FallTime: 2
           FallDelay: 0

Display information about the configured gsmUplinkConfig object by using the gsmInfo function. Assign the sample rate to a variable, Rs, for use in computing the plot timescale.

wfInfo = gsmInfo(cfggsmul)
wfInfo = struct with fields:
              SymbolRate: 2.7083e+05
              SampleRate: 4.3333e+06
    BandwidthTimeProduct: 0.3000
    BurstLengthInSymbols: 156.2500
       NumBurstsPerFrame: 8
    BurstLengthInSamples: 2500
    FrameLengthInSamples: 20000

Rs = wfInfo.SampleRate;

Create the GSM waveform by using the gsmFrame function, and then plot the GSM waveform.

waveform = gsmFrame(cfggsmul);

t = (0:length(waveform)-1)/Rs*1e3;
subplot(2,1,1)
plot(t,abs(waveform))
grid on
axis([0 5 0 1.2])
title('GSM Uplink Waveform - Amplitude')
xlabel('Time (ms)')
ylabel('Amplitude')
subplot(2,1,2)
plot(t,unwrap(angle(waveform)))
grid on
title('GSM Uplink Waveform - Phase')
xlabel('Time (ms)')
ylabel('Phase (rad)')

Figure contains 2 axes objects. Axes object 1 with title GSM Uplink Waveform - Amplitude, xlabel Time (ms), ylabel Amplitude contains an object of type line. Axes object 2 with title GSM Uplink Waveform - Phase, xlabel Time (ms), ylabel Phase (rad) contains an object of type line.

Create a GSM downlink TDMA frame configuration object with default settings, and then create a GSM waveform containing five TDMA frames. GSM TDMA frames have eight time slots, each separated by a guard period of 8.25 symbols or about 30.46x10e-3 ms. Plot the GSM waveform.

Create a GSM uplink TDMA frame configuration object, specifying 3 dB of attenuation in the last time slot to help identify the end of each frame.

cfggsmul = gsmUplinkConfig('Attenuation',[0 0 0 0 0 0 0 3])
cfggsmul = 
  gsmUplinkConfig with properties:

           BurstType: [NB    NB    NB    NB    NB    NB    NB    NB]
    SamplesPerSymbol: 16
                 TSC: [0 1 2 3 4 5 6 7]
         Attenuation: [0 0 0 0 0 0 0 3]
         PulseLength: 4
            RiseTime: 2
           RiseDelay: 0
            FallTime: 2
           FallDelay: 0

Display information about the configured gsmUplinkConfig object by using the gsmInfo function. Assign the frame length in samples to a variable, spf, for use in computing the plot timescale.

wfInfo = gsmInfo(cfggsmul)
wfInfo = struct with fields:
              SymbolRate: 2.7083e+05
              SampleRate: 4.3333e+06
    BandwidthTimeProduct: 0.3000
    BurstLengthInSymbols: 156.2500
       NumBurstsPerFrame: 8
    BurstLengthInSamples: 2500
    FrameLengthInSamples: 20000

spf = wfInfo.FrameLengthInSamples;

Create the GSM waveform by using the gsmFrame function, and then plot the GSM waveform. The last time slot of each frame is 3 dB less than the other time slots in that frame.

numFrames = 5;
waveform = gsmFrame(cfggsmul,numFrames);

t = 8*(0:length(waveform)-1)/spf;

numTS = 8*numFrames;
subplot(2,1,1)
plot(t,abs(waveform))
grid on
axis([0 numTS 0 1.2])
title('GSM Uplink Waveform - Amplitude')
xlabel('Time Slots')
ylabel('Amplitude')
subplot(2,1,2)
plot(t,unwrap(angle(waveform)))
grid on
title('GSM Uplink Waveform - Phase')
xlabel('Time Slots')
ylabel('Phase (rad)')

Figure contains 2 axes objects. Axes object 1 with title GSM Uplink Waveform - Amplitude, xlabel Time Slots, ylabel Amplitude contains an object of type line. Axes object 2 with title GSM Uplink Waveform - Phase, xlabel Time Slots, ylabel Phase (rad) contains an object of type line.

Create a GSM downlink TDMA frame configuration object with default settings, and then create a GSM waveform containing one TDMA frame. The GSM TDMA frame has eight time slots, each separated by a guard period of 8.25 symbols or about 30.46x10e-3 ms. Plot the GSM waveform.

Create a GSM downlink TDMA frame configuration object with default settings.

cfggsmdl = gsmDownlinkConfig
cfggsmdl = 
  gsmDownlinkConfig with properties:

           BurstType: [NB    NB    NB    NB    NB    NB    NB    NB]
    SamplesPerSymbol: 16
                 TSC: [0 1 2 3 4 5 6 7]
         Attenuation: [0 0 0 0 0 0 0 0]
         PulseLength: 4
            RiseTime: 2
           RiseDelay: 0
            FallTime: 2
           FallDelay: 0

Display information about the configured gsmDownlinkConfig object by using the gsmInfo function. Assign the sample rate to a variable, Rs, for use in computing the plot timescale.

wfInfo = gsmInfo(cfggsmdl)
wfInfo = struct with fields:
              SymbolRate: 2.7083e+05
              SampleRate: 4.3333e+06
    BandwidthTimeProduct: 0.3000
    BurstLengthInSymbols: 156.2500
       NumBurstsPerFrame: 8
    BurstLengthInSamples: 2500
    FrameLengthInSamples: 20000

Rs = wfInfo.SampleRate;

Create the GSM waveform by using the gsmFrame function, and then plot the GSM waveform.

waveform = gsmFrame(cfggsmdl);

t = (0:length(waveform)-1)/Rs*1e3;
subplot(2,1,1)
plot(t,abs(waveform))
grid on
axis([0 5 0 1.2])
title('GSM Downlink Waveform - Amplitude')
xlabel('Time (ms)')
ylabel('Amplitude')
subplot(2,1,2)
plot(t,unwrap(angle(waveform)))
grid on
title('GSM Downlink Waveform - Phase')
xlabel('Time (ms)')
ylabel('Phase (rad)')

Figure contains 2 axes objects. Axes object 1 with title GSM Downlink Waveform - Amplitude, xlabel Time (ms), ylabel Amplitude contains an object of type line. Axes object 2 with title GSM Downlink Waveform - Phase, xlabel Time (ms), ylabel Phase (rad) contains an object of type line.

Input Arguments

collapse all

GSM configuration, specified as a gsmUplinkConfig or gsmDownlinkConfig object.

Number of TDMA frames in the waveform, specified as a positive integer.

Data Types: double

Output Arguments

collapse all

Output time-domain waveform, returned as a complex-valued column vector of length Ns, where Ns represents the number of time-domain samples. The function generates this waveform in the form of complex in-phase quadrature (IQ) samples.

More About

collapse all

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2019b

expand all