Main Content

gsmUplinkConfig

Create GSM uplink TDMA frame configuration object

Description

The gsmUplinkConfig object is a GSM uplink TDMA frame configuration object. Use gsmUplinkConfig objects to create GSM uplink waveforms.

Creation

Description

cfggsmul = gsmUplinkConfig creates a GSM uplink TDMA frame configuration object.

example

cfggsmul = gsmUplinkConfig(sps) sets the SamplesPerSymbol property to sps.

example

cfggsmul = gsmUplinkConfig(___,Name,Value) sets one or more name-value pair arguments using any of the previous syntaxes. For example, 'RiseTime',4 sets the burst rise time to 4 symbols. Enclose each property in quotes. Specify name-value pair arguments after all other input arguments.

example

Properties

expand all

Samples per symbol, specified as a positive integer multiple of 4.

Data Types: double

Burst types for time slots 0–7 in the TDMA frame, specified as one of these options:

  • Eight-element row vector where each value is "NB", "AB", or "Off" — Each element specifies the burst type for the corresponding time slot.

  • "NB" — Transmit data using a normal burst for every time slot.

  • "AB" — Transmit data using an access burst for every time slot.

  • "Off" — All eight time slots contain no data.

For more information, see GSM Frames, Time Slots, and Bursts

Note

The BurstType property is an enumeration. To perform code generation, see Code Generation and the MEX Generation for GSM Uplink Waveform example.

Example: ["NB" "AB" "AB" "NB" "Off" "NB" "AB" "Off"] configures the frame to use normal bursts in time slots 0, 3, and 5, use access bursts in time slots 1, 2, and 6, and transmit no data in time slots 4 and 7.

Training sequence code (TSC) for normal bursts in time slots 0 – 7 in the TDMA frame, specified as one of these options:

  • Eight-element row vector of integers in the range [0, 7] — Each element specifies the TSC value for the corresponding normal burst time slot.

  • Integer in the range [0, 7] — Specifies the TSC value for every normal burst time slot.

For more information, see Training Sequence Code (TSC).

Example: [5 7 0 0 0 0 0 0] configures the frame to use training sequence 5 in time slot 0, training sequence 7 in time slot 1, and training sequence 0 in time slots 2 through 7.

Dependencies

To enable this property for a time slot, set the corresponding element of BurstType to "NB".

Data Types: double

Power attenuation in dB for time slots 0–7 in the TDMA frame, specified as one of these options:

  • Eight-element row vector of nonnegative integers — Each element specifies the attenuation power value for the corresponding time slot.

  • Nonnegative integer — Specifies the power attenuation value for every time slot.

Example: [0 0 0 0 0 0 0 3] configures the frame to apply 0 dB of attenuation to the burst signal power in time slot 0 through 6 and 3 dB of attenuation to the burst signal power in time slot 7.

Data Types: double

Gaussian pulse length in symbol durations, specified as a positive integer.

Data Types: double

Burst rise time in symbols, specified as a positive scalar in the range [1/SamplesPerSymbol, 29], where the increment resolution is 1/SamplesPerSymbol. The total ramp-up and ramp-down duration (RiseTime - RiseDelay + FallTime + FallDelay) must be less than 9.25 symbols. The characteristic shape of the rising edge of the burst is sinusoidal.

For more information, see GSM Frames, Time Slots, and Bursts.

Data Types: double

Burst rise delay in symbols, specified as a positive scalar in the range [–10, 10], where the increment resolution is 1/SamplesPerSymbol. The total ramp-up and ramp-down duration (RiseTime - RiseDelay + FallTime + FallDelay) must be less than 9.25 symbols. The burst rise delay is measured with respect to the start of the useful part of the burst. For more information, see GSM Frames, Time Slots, and Bursts.

When the burst rise delay is 0, the burst reaches full amplitude at the start of the useful part of the burst. When the burst rise delay is positive, the burst reaches full amplitude RiseDelay symbols after the start of the useful part. When the burst rise delay is negative, the burst reaches full amplitude RiseDelay symbols before the start of the useful part.

Data Types: double

Burst fall time in symbols, specified as a positive scalar in the range [1/SamplesPerSymbol, 29], where the increment resolution is 1/SamplesPerSymbol. The total ramp-up and ramp-down duration (RiseTime - RiseDelay + FallTime + FallDelay) must be less than 9.25 symbols. The characteristic shape of the falling edge of the burst is sinusoidal.

For more information, see GSM Frames, Time Slots, and Bursts.

Data Types: double

Burst fall delay in symbols, specified as a positive scalar in the range [–10, 10], where the increment resolution is 1/SamplesPerSymbol. The total ramp-up and ramp-down duration (RiseTime - RiseDelay + FallTime + FallDelay) must be less than 9.25 symbols. The burst fall delay is measured with respect to the end of the useful part of the burst. For more information, see GSM Frames, Time Slots, and Bursts.

When the burst fall delay is 0, the burst begins decreasing from full amplitude at the end of the useful part of the burst. When the burst fall delay is positive, the burst begins decreasing from full amplitude FallDelay symbols after the end of the useful part. When the burst fall delay is negative, the burst begins decreasing from full amplitude FallDelay symbols before the end of the useful part.

Data Types: double

Output Arguments

expand all

GSM uplink TDMA frame configuration, returned as a structure.

Data Types: struct

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 uplink TDMA frame configuration object that specifies 4 samples per symbol, and then create a GSM waveform containing one GSM downlink TDMA frame. The GSM TDMA frame are eight time slots, each separated by a guard period of 8.25 symbols or about 30.46x10e-3 ms separates each time slot. Plot the GSM waveform.

Create a GSM uplink TDMA frame configuration object, specifying 4 samples per symbols.

sps = 4;
cfggsmul = gsmUplinkConfig(sps)
cfggsmul = 
  gsmUplinkConfig with properties:

           BurstType: [NB    NB    NB    NB    NB    NB    NB    NB]
    SamplesPerSymbol: 4
                 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: 1.0833e+06
    BandwidthTimeProduct: 0.3000
    BurstLengthInSymbols: 156.2500
       NumBurstsPerFrame: 8
    BurstLengthInSamples: 625
    FrameLengthInSamples: 5000

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 two GSM uplink TDMA frame configuration objects. Specify default settings for the first gsmUplinkConfig object and adjust the signal power per time slot for the second. Generate GSM waveforms for both configurations. Plot the waveforms to show the signal attenuation per time slot in the second 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

Create another GSM uplink TDMA frame configuration object, adjusting the signal attenuation settings per time slot.

cfggsmul2 = gsmUplinkConfig('Attenuation',[1 2 3 4 5 4 3 2])
cfggsmul2 = 
  gsmUplinkConfig with properties:

           BurstType: [NB    NB    NB    NB    NB    NB    NB    NB]
    SamplesPerSymbol: 16
                 TSC: [0 1 2 3 4 5 6 7]
         Attenuation: [1 2 3 4 5 4 3 2]
         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 waveforms, containing one TDMA frame, by using the gsmFrame function. GSM TDMA frames are eight time slots, each separated by a guard period of 8.25 symbols or about 30.46x10e-3 ms. Plot each GSM waveform.

waveform = gsmFrame(cfggsmul);
waveform2 = gsmFrame(cfggsmul2);

t = (0:length(waveform)-1)/Rs*1e3;
subplot(2,1,1)
plot(t,[abs(waveform),abs(waveform2)])
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)),unwrap(angle(waveform2))])
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 2 objects of type line. Axes object 2 with title GSM Uplink Waveform - Phase, xlabel Time (ms), ylabel Phase (rad) contains 2 objects of type line.

Generate and run a GSM waveform MEX function from the helper function createUplinkWaveform. The createUplinkWaveform helper function creates a GSM uplink waveform.

Write MATLAB Function

Open createUplinkWaveform.m to see the code. The createUplinkWaveform helper function generates a GSM uplink waveform by using the gsmUplinkConfig object and the gsmInfo and gsmFrame functions.

Generate GSM Waveform

Use the createUplinkWaveform helper function to create a GSM waveform containing three TDMA frames, and then plot the waveform.

[x,t] = createUplinkWaveform(3);

figure
subplot(2,1,1);
plot(t,abs(x));
grid on;
title('GSM Uplink Waveform - Amplitude');
xlabel('Time (ms)');
ylabel('Amplitude')
subplot(2,1,2);
plot(t,unwrap(angle(x)));
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.

Generate MEX Function

Code generation defaults to MEX code generation when you do not specify a build target. By default, codegen names the generated MEX function createUplinkWaveform_mex. Generate a MEX function from the createUplinkWaveform helper function, and then run the MEX function to create three TDMA frames.

codegen createUplinkWaveform -args 3
Code generation successful.

Generate Waveform Using MEX Function

Run the MEX function and plot the results. Since the waveform is created using random data, the phase plot changes each time you run the generateUplinkFrame helper function or createUplinkWaveform_mex function.

[x,t] = createUplinkWaveform_mex(3);

figure
subplot(2,1,1);
plot(t,abs(x));
grid on;
title('MEX - GSM Uplink Waveform - Amplitude');
xlabel('Time (ms)');
ylabel('Amplitude')
subplot(2,1,2);
plot(t,unwrap(angle(x)));
grid on;
title('MEX - GSM Uplink Waveform - Phase');
xlabel('Time (ms)');
ylabel('Phase (rad)')

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

Model a GSM waveform generator in Simulink® by using the MATLAB® Function block and Communications Toolbox™ functions.

GSM Uplink Waveform Generation

The MATLAB Function (Simulink) block contains the gsmUplinkWaveform function code. The code in the MATLAB Function block creates a GSM waveform by using the gsmUplinkConfig object and the gsmFrame function.

The gsmUplinkConfig object specifies 16 samples per symbol and the time slot configuration for the GSM uplink TDMA frame shown is this table.

$$ \begin{array}{|c|l|c|}
\hline\vphantom{\displaystyle\int}\mathbf{Timeslot}&\begin{array}{l}\mathbf{Burst\ Type}\end{array}&\mathbf{Attenuation}\\
\hline0&\begin{array}{l}\mathrm{Normal\ burst}\end{array}&\begin{array}{l}\mathrm{0\ dB}\end{array}\\
\hline1&\begin{array}{l}\mathrm{Access\ burst}\end{array}&\begin{array}{l}\mathrm{0\ dB}\end{array}\\
\hline2&\begin{array}{l}\mathrm{Normal\ burst}\end{array}&\begin{array}{l}\mathrm{3\ dB}\end{array}\\
\hline3&\begin{array}{l}\mathrm{Normal\ burst}\end{array}&\begin{array}{l}\mathrm{0\ dB}\end{array}\\
\hline4&\begin{array}{l}\mathrm{No\ data}\end{array}&\begin{array}{l}\mathrm{0\ dB}\end{array}\\
\hline5&\begin{array}{l}\mathrm{Normal\ burst}\end{array}&\begin{array}{l}\mathrm{6\ dB}\end{array}\\
\hline6&\begin{array}{l}\mathrm{Normal\ burst}\end{array}&\begin{array}{l}\mathrm{0\ dB}\end{array}\\
\hline7&\begin{array}{l}\mathrm{Normal\ burst}\end{array}&\begin{array}{l}\mathrm{3\ dB}\end{array}\\
\hline\end{array} $$

The output waveform has 16 samples for each GMSK symbol. The gsmFrame function generates the samples of the waveform.

Explore the Model

In compliance with GSM standards 3GPP TS 45.001 and 3GPP TS 45.002, the sample time of the MATLAB Function block that contains the gsmUplinkWaveform function code is set to the GSM symbol rate of 1625e3/6 symbols per second. Display the current gsmUplinkConfig object settings by using the gsmInfo function.

wfInfo = 

  struct with fields:

              SymbolRate: 2.7083e+05
              SampleRate: 4.3333e+06
    BandwidthTimeProduct: 0.3000
    BurstLengthInSymbols: 156.2500
       NumBurstsPerFrame: 8
    BurstLengthInSamples: 2500
    FrameLengthInSamples: 20000

The model sample time of the MATLAB Function (Simulink) block is set to wfInfo.FrameLengthInSamples/wfInfo.SampleRate. To view the Sample time parameter, open the Block Parameters dialog box by right-clicking the MATLAB Function block and selecting Block Parameters (Subsystem).

Before the simulation runs, you must configure the sample rate of the MATLAB Function block. The PreLoadFcn and InitFcn callback functions configure the MATLAB Function block by creating a gsmUplinkConfig object and wfInfo structure. To view the callback functions, on the Modeling tab, in the Setup section, select Model Settings > Model Properties. Then, on the Callbacks tab, select the PreLoadFcn or InitFcn callback function in the Model callbacks pane.

Results

Displays the time domain signal and the spectrogram by running the simulation.

More About

expand all

References

[1] 3GPP TS 45.001. "GSM/EDGE Physical layer on the radio path. General description." 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[2] 3GPP TS 45.002. "GSM/EDGE Multiplexing and multiple access on the radio path." 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[3] 3GPP TS 45.004. "GSM/EDGE Modulation." 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

Extended Capabilities

Version History

Introduced in R2019b

expand all