# semianalytic

Calculate bit error rate (BER) using semianalytic technique

## Syntax

```ber = semianalytic(txsig,rxsig,modtype,M,Nsamp) ber = semianalytic(txsig,rxsig,modtype,M,Nsamp,num,den) ber = semianalytic(txsig,rxsig,modtype,M,Nsamp,EbNo) ber = semianalytic(txsig,rxsig,modtype,M,Nsamp,num,den,EbNo) [ber,avgampl,avgpower] = semianalytic(...) ```

## Description

`ber = semianalytic(txsig,rxsig,modtype,M,Nsamp)` returns the bit error rate (BER) of a system that transmits the complex baseband vector signal `txsig` and receives the noiseless complex baseband vector signal `rxsig`. Each of these signals has `Nsamp` samples per symbol. `Nsamp` is also the sampling rate of `txsig` and `rxsig`, in Hz. The function assumes that `rxsig` is the input to the receiver filter, and the function filters `rxsig` with an ideal integrator. `modtype` is the modulation type of the signal and `M` is the alphabet size. The table below lists the valid values for `modtype` and `M`.

Modulation SchemeValue of modtypeValid Values of M
Differential phase shift keying (DPSK) `'dpsk'` 2, 4
Minimum shift keying (MSK) with differential encoding`'msk/diff'` 2
Minimum shift keying (MSK) with nondifferential encoding`'msk/nondiff'` 2
Phase shift keying (PSK) with differential encoding, where the phase offset of the constellation is 0 `'psk/diff'` 2, 4
Phase shift keying (PSK) with nondifferential encoding, where the phase offset of the constellation is 0 `'psk/nondiff'` 2, 4, 8, 16, 32, or 64
Offset quadrature phase shift keying (OQPSK) `'oqpsk'` 4
Quadrature amplitude modulation (QAM) `'qam'` 4, 8, 16, 32, 64, 128, 256, 512, 1024

`'msk/diff'` is equivalent to conventional MSK (setting the `'Precoding'` property of the MSK object to `'off'`), while `'msk/nondiff'` is equivalent to precoded MSK (setting the `'Precoding'` property of the MSK object to `'on'`).

Note

The output `ber` is an upper bound on the BER in these cases:

• DQPSK (`modtype` = `'dpsk'`, `M` = 4)

• Cross QAM (`modtype` = `'qam'`, `M` not a perfect square). In this case, note that the upper bound used here is slightly tighter than the upper bound used for cross QAM in the `berawgn` function.

When the function computes the BER, it assumes that symbols are Gray-coded. The function calculates the BER for values of Eb/N0 in the range of [0:20] dB and returns a vector of length 21 whose elements correspond to the different Eb/N0 levels.

Note

You must use a sufficiently long vector `txsig`, or else the calculated BER will be inaccurate. If the system's impulse response is L symbols long, the length of `txsig` should be at least `M`L. A common approach is to start with an augmented binary pseudonoise (PN) sequence of total length `(log2M)M`L. An augmented PN sequence is a PN sequence with an extra zero appended, which makes the distribution of ones and zeros equal.

`ber = semianalytic(txsig,rxsig,modtype,M,Nsamp,num,den)` is the same as the previous syntax, except that the function filters `rxsig` with a receiver filter instead of an ideal integrator. The transfer function of the receiver filter is given in descending powers of z by the vectors `num` and `den`.

`ber = semianalytic(txsig,rxsig,modtype,M,Nsamp,EbNo)` is the same as the first syntax, except that `EbNo` represents Eb/N0, the ratio of bit energy to noise power spectral density, in dB. If `EbNo` is a vector, then the output `ber` is a vector of the same size, whose elements correspond to the different Eb/N0 levels.

`ber = semianalytic(txsig,rxsig,modtype,M,Nsamp,num,den,EbNo)` combines the functionality of the previous two syntaxes.

`[ber,avgampl,avgpower] = semianalytic(...)` returns the mean complex signal amplitude and the mean power of `rxsig` after filtering it by the receiver filter and sampling it at the symbol rate.

## Examples

A typical procedure for implementing the semianalytic technique is in Procedure for the Semianalytic Technique. Sample code is in Using Semianalytic Technique.

## Limitations

The function makes several important assumptions about the communication system. See When to Use the Semianalytic Technique to find out whether your communication system is suitable for the semianalytic technique and the `semianalytic` function.

## Alternatives

As an alternative to the `semianalytic` function, invoke the BERTool GUI (`bertool`) and use the Semianalytic tab.

## References

 Jeruchim, M. C., P. Balaban, and K. S. Shanmugan, Simulation of Communication Systems, New York, Plenum Press, 1992.

 Pasupathy, S., “Minimum Shift Keying: A Spectrally Efficient Modulation,” IEEE Communications Magazine, July, 1979, pp. 14–22.