Main Content

qfunc

Syntax

Description

example

y= qfunc(x)returns the output of the Q function for each element of the real-valued input. The Q function is (1 –f), wherefis the result of the cumulative distribution function of the standardized normal random variable. For more information, seeAlgorithms.

Examples

collapse all

Calculate the Q function values for a real-valued input vector.

x = -4:0.1:4; y = qfunc(x);

Plot the results.

plot(x,y) grid

Figure contains an axes object. The axes object contains an object of type line.

Calculate the QPSK error probability at an E b / N 0 setting of 7 dB by using the Q function.

Convert the E b / N 0 in dB to its linear equivalent.

ebnodB = 7; ebno = 10^(ebnodB/10);

Using the Q function, calculate the QPSK error probability, P b = Q ( 2 E b N 0 ) .

Pb = qfunc(sqrt(2*ebno))
Pb = 7.7267e-04

Input Arguments

collapse all

Input, specified as a real-valued scalar, matrix, or array.

Data Types:double

Output Arguments

collapse all

Q function output, returned as a scalar, matrix, or array.yhas the same dimensions as inputx. Output values are in the range [0, 1].

Algorithms

For a scalarx, the Q function is (1 –f), wherefis the result of the cumulative distribution function of the standardized normal random variable. The Q function is defined as

Q ( x ) = 1 2 π x exp ( t 2 / 2 ) d t

The Q function is related to the complementary error function,误差补函数, according to

Q ( x ) = 1 2 误差补函数 ( x 2 )

Introduced before R2006a