Demodulate using arbitrary QAM constellation
The GeneralQAMDemodulator object demodulates a signal that was modulated using quadrature amplitude modulation. The input is a baseband representation of the modulated signal.
To demodulate a signal that was modulated using quadrature amplitude modulation:
H = comm.GeneralQAMDemodulator creates a demodulator System object™, H. This object demodulates the input signal using a general quadrature amplitude modulation (QAM) method.
H = comm.GeneralQAMDemodulator(Name,Value) creates a general QAM demodulator object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).
H = comm.GeneralQAMDemodulator(CONST,Name,Value) creates a general QAM demodulator object, H. This object has the Constellation property set to CONST, and the other specified properties set to the specified values.
Specify the constellation points as a real or complex, double-precision data type vector. The default is exp(). The length of the vector determines the modulation order.
When you set the BitOutput property to false, the step method outputs a vector with integer values. These integers are between 0 and M–1, where M is the length of this property vector. The length of the output vector equals the length of the input signal.
When you set the BitOutput property to true, the output signal contains bits. For bit outputs, the size of the signal constellation requires an integer power of two and the output length is an integer multiple of the number of bits per symbol.
Output data as bits
Specify whether the output consists of groups of bits or integer symbol values. The default is false.
When you set this property to true the step method outputs a column vector of bit values with length equal to log2(M) times the number of demodulated symbols, where M is the length of the signal constellation specified in the Constellation property. The length M determines the modulation order.
When you set this property to false, the step method outputs a column vector, of length equal to the input data vector. The vector contains integer symbol values between 0 and M–1.
Demodulation decision method
Specify the decision method the object uses as one of Hard decision | Log-likelihood ratio | Approximate log-likelihood ratio. The default is Hard decision. When you set the BitOutput property to false the object always performs hard decision demodulation. This property applies when you set the BitOutput property to true.
Source of noise variance
Specify the source of the noise variance as one of Property | Input port. The default is Property. This property applies when you set the DecisionMethod property to Log-likelihood ratio or Approximate log-likelihood ratio.
Specify the variance of the noise as a nonzero, real scalar value. The default is 1. If this value is very small (i.e., SNR is very high), log-likelihood ratio (LLR) computations may yield Inf or -Inf. This result occurs because the LLR algorithm would compute the exponential of very large or very small numbers using finite-precision arithmetic. In such cases, using approximate LLR is recommended because its algorithm does not compute exponentials. This property applies when you set the VarianceSource property to Property. This property is tunable.
Data type of output
Specify the output data type as one of Full precision | Smallest unsigned integer | double | single | int8 | uint8 | int16 | uint16 | int32 | uint32. The default is Full precision .
This property applies only when you set the BitOutput property to false or when you set the BitOutput property to true and the DecisionMethod property to Hard decision or Approximate log-likelihood ratio. In this case, when you set the OutputDataType property to Full precision, the output data type is the same as that of the input when the input data has a single or double-precision data type.
When the input data is of a fixed-point type, the output data type works as if you had set the OutputDataType property to Smallest unsigned integer.
When the input signal is an integer data type, you must have a Fixed-Point Designer™ user license to use this property in Smallest unsigned integer or Full precision mode.
When you set the BitOutput property to true, and the DecisionMethod property to Hard Decision the data type logical becomes a valid option.
When you set the BitOutput property to true and the DecisionMethod property to Approximate log-likelihood ratio you may only set this property to Full precision | Custom.
If you set the BitOutput property to true and the DecisionMethod property to Log-likelihood ratio, the output data has the same type as that of the input. In this case, that value can be only single or double precision.
|clone||Create general QAM demodulator object with same property values|
|getNumInputs||Number of expected inputs to step method|
|getNumOutputs||Number of outputs from step method|
|isLocked||Locked status for input attributes and nontunable properties|
|release||Allow property value and input characteristics changes|
|step||Demodulate using arbitrary QAM constellation|
Modulate and demodulate data using an arbitrary three-point constellation.
% Setup a three point constellation c = [1 1i -1]; hQAMMod = comm.GeneralQAMModulator(c); hAWGN = comm.AWGNChannel('NoiseMethod', ... 'Signal to noise ratio (SNR)','SNR',15, 'SignalPower', 0.89); hQAMDemod = comm.GeneralQAMDemodulator(c); %Create an error rate calculator hError = comm.ErrorRate; for counter = 1:100 % Transmit a 50-symbol frame data = randi([0 2],50,1); modSignal = step(hQAMMod, data); noisySignal = step(hAWGN, modSignal); receivedData = step(hQAMDemod, noisySignal); errorStats = step(hError, data, receivedData); end fprintf('Error rate = %f\nNumber of errors = %d\n', ... errorStats(1), errorStats(2))
This object implements the algorithm, inputs, and outputs described on the General QAM Demodulator Baseband block reference page. The object properties correspond to the block parameters.