main content

measure error vector magnitude (evm) of received signal -凯发k8网页登录

measure error vector magnitude (evm) of received signal

description

the comm.evm system object™ measures the root mean squared (rms) evm, maximum evm, and percentile evm of a received signal.

to measure the evm of a received signal:

  1. create the comm.evm object and set its properties.

  2. call the object with arguments, as if it were a function.

to learn more about how system objects work, see what are system objects?

creation

description

example

evm = comm.evm creates an evm measurement system object.

example

evm = comm.evm(name=value) sets properties using one or more name-value arguments. for example, comm.evm(referencesignalsource="estimated from reference constellation") configures the object to measure the evm of a received signal relative to a reference constellation.

properties

unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. objects lock when you call them, and the function unlocks them.

if a property is tunable, you can change its value at any time.

for more information on changing property values, see .

normalization method used in evm calculation, specified as 'average reference signal power', 'average constellation power', or 'peak constellation power'.

data types: char | string

average constellation power in watts, specified as a positive scalar.

dependencies

to enable this property, set the normalization property to 'average constellation power'.

data types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

peak constellation power in watts, specified as a positive scalar.

dependencies

to enable this property, set the normalization property to 'peak constellation power'.

data types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

reference signal source, specified as 'input port' or 'estimated from reference constellation'. to provide an explicit reference signal against which to measure received signal, set this property to 'input port'. to measure the evm of the received signal against a reference constellation, set this property to 'estimated from reference constellation'.

data types: char | string

reference constellation, specified as a vector. the default value corresponds to a quadrature phase-shift keying (qpsk) constellation with unit average power. you can derive constellation points by using modulation functions or objects. for example, to derive the reference constellation for a 16-point quadrature amplitude modulated (16-qam) signal, use the function.

example: qammod(0:15,16)

dependencies

to enable this property, set the referencesignalsource property to 'estimated from reference constellation'.

data types: double
complex number support: yes

measurement interval source for rms and maximum evm measurements, specified as one of these values.

  • 'input length' — measure evm using only the current samples.

  • 'entire history' — measure evm for all samples.

  • 'custom' — measure evm over an interval you specify and use a sliding window.

  • 'custom with periodic reset' — measure evm over an interval you specify and reset the object after measuring over each interval.

data types: char | string

measurement interval, specified as a positive integer.

dependencies

to enable this property, set the measurementintervalsource property to 'custom' or 'custom with periodic reset'.

data types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

averaging dimensions over which the object averages the evm measurements, specified as a vector of integers in the range [1, 3]. for example, to average across the rows, set this property to 2.

this object supports variable-size inputs of the dimensions across which the averaging takes place. however, the input size for the non-averaged dimensions must remain constant between calls to the object. for example, if the input has size [1000 3 2] and you set this property to [1 3], the output size is [1 3 1], and the number of elements in the second dimension must remain fixed at 3.

data types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

option to return maximum evm measurements, specified as a logical 1 (true) or 0 (false).

data types: logical

option to return x-percentile evm measurements, that is, the value below which x% of evm measurements fall, specified as a logical 1 (true) or 0 (false). when you set this property to 1 (true), x-percentile evm measurements persist until you reset the object. the object performs these measurements by using all of the input frames since the last reset.

data types: logical

value below which x% of evm measurements fall, specified as a scalar in the range [0, 100].

dependencies

to enable this property, set the xpercentileevmoutputport property to true.

data types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

option to return the number of accumulated symbols that the object uses to measure the x-percentile evm since the last reset, specified as a logical 1 (true) or 0 (false).

dependencies

to enable this property, set the xpercentileevmoutputport property to true.

data types: logical

usage

description

example

rmsevm = evm(refsym,rxsym) measures the percentage rms evm of received signal rxsym relative to reference signal refsym over the measurement interval specified in the measurementintervalsource and measurementinterval properties.

[rmsevm,maxevm] = evm(refsym,rxsym) also measures the maximum percentage evm over the configured measurement interval.

to use this syntax, set the maximumevmoutputport property to true.

[___,xevm] = evm(refsym,rxsym) also measures the value below which x% of evm measurements fall using all input frames since the last reset, regardless of measurement interval configuration. set the value of x in the xpercentilevalue property. for example, if you set the xpercentilevalue to 95, then 95% of all evm measurements since the last reset fall below the value of xevm. you can use this syntax with any previous output argument combination.

to use this syntax, set the xpercentileevmoutputport property to true.

example

[___,numsym] = evm(refsym,rxsym) also returns the number of symbols used to measure the x-percentile evm. to use this syntax, set the xpercentileevmoutputport and symbolcountoutputport properties to true.

example

[___] = evm(rxsym) measures the evm of the received signal relative to the reference signal specified in the referenceconstellation property. you can use this syntax with any previous output argument combination.

to use this syntax, set the referencesignalsource property to 'estimated from reference constellation' and the referenceconstellation property to a vector of length equal to that of the rxsym input.

input arguments

reference signal, specified as a scalar, vector, matrix, or 3-d array. if you specify this input, the object measures the evm of the rxsym input by using this input as a reference constellation.

the dimensions of this input must match those of the rxsym input. the object uses each element of this input as the reference symbol for the corresponding element of the rxsym input.

data types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
complex number support: yes

received signal, specified as a scalar, vector, matrix, or 3-d array.

data types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
complex number support: yes

output arguments

percentage rms evm of the received signal over the configured measurement interval, returned as a scalar.

data types: double

maximum percentage evm over the configured measurement interval, returned as a scalar.

data types: double

value below which x% of evm measurements fall since the last reset, returned as a scalar in the range [0, 100]. set the value of x in the xpercentilevalue property.

data types: double

number of symbols that the object uses to measure the xevm output, returned as a positive integer.

data types: double

object functions

to use an object function, specify the system object as the first input argument. for example, to release system resources of a system object named obj, use this syntax:

release(obj)
run system object algorithm
release resources and allow changes to system object property values and input characteristics
reset internal states of system object

examples

generate random data symbols and apply 8-psk modulation.

d = randi([0 7],2000,1);
txsig = pskmod(d,8,pi/8);

pass the modulated signal through an additive white gaussian noise (awgn) channel.

rxsig = awgn(txsig,30);

create an evm object. measure the rms evm using the transmitted signal as the reference.

evm = comm.evm;
rmsevm1 = evm(txsig,rxsig);

release the evm measurement system object. configure the object to estimate the evm of the received signal against a reference constellation.

release(evm)
evm.referencesignalsource = "estimated from reference constellation";
evm.referenceconstellation = pskmod(0:7,8,pi/8);

measure the rms evm using only the received signal as an input, and then verify that the two evm results match.

rmsevm2 = evm(rxsig);
isequal(rmsevm1,rmsevm2)
ans = logical
   1

create ofdm modulator and demodulator system objects.

ofdmmod = comm.ofdmmodulator(fftlength=32,numsymbols=4);
ofdmdemod = comm.ofdmdemodulator(fftlength=32,numsymbols=4);

determine the number of subcarriers and symbols in the ofdm signal.

ofdmdims = info(ofdmmod);
numsc = ofdmdims.datainputsize(1);
numsym = ofdmdims.datainputsize(2);

generate random symbols and apply qpsk modulation.

msg = randi([0 3],numsc,numsym);
rxsym = pskmod(msg,4,pi/4);

ofdm modulate the qpsk signal. pass the signal through an awgn channel. demodulate the noisy signal.

txsig = ofdmmod(rxsym);
rxsig = awgn(txsig,10,"measured");
refsym = ofdmdemod(rxsig);

configure an evm measurement system object to average the evm measurement over the subcarriers. measure the evm. the four entries correspond to each of the four ofdm symbols.

evm = comm.evm(averagingdimensions=1);
rmsevm = evm(refsym,rxsym)
rmsevm = 1×4
   28.3317   25.7689   21.7944   23.5579

configure the evm measurement system object to average the evm measurement over the ofdm symbols. measure the evm. the 21 entries correspond to each of the 21 subcarriers.

evm = comm.evm(averagingdimensions=2);
rmsevm = evm(refsym,rxsym);
disp(rmsevm')
   28.5667   16.3509   21.3003   22.6700   25.4878   26.7996   28.4253   32.7493   34.5155   19.7745   18.7687   21.5631   20.2539   12.2082   25.3397   43.9916   26.8119   22.6613   29.5975   19.3420   16.1452

measure the evm and average over both the subcarriers and the ofdm symbols.

evm = comm.evm(averagingdimensions=[1 2]);
rmsevm = evm(refsym,rxsym)
rmsevm = 24.8838

calculate and plot the evm of an ofdm signal. the signal consists of two packets separated by an interval.

create system objects to:

  • ofdm-modulate a signal.

  • introduce phase noise.

  • plot time-varying signals.

ofdmmod = comm.ofdmmodulator(fftlength=256,numsymbols=2);
pnoise = comm.phasenoise(level=-60,frequencyoffset=20,samplerate=1000);
tscope = timescope(ylabel="evm (%)",ylimits=[0 40], ...
    samplerate=1000,timespansource="property",timespan=1.2, ...
    showgrid=true);

configure an evm measurement system object to generate a time-varying estimate of the evm.

evm = comm.evm(maximumevmoutputport=false, ...
    referencesignalsource="input port", ...
    averagingdimensions=2);

determine the input data dimensions of the ofdm modulator.

moddims = info(ofdmmod);

create qpsk-modulated random data for the first packet. apply ofdm modulation.

data = randi([0 3],moddims.datainputsize);
qpsksig = pskmod(data,4,pi/4);
txsig1 = ofdmmod(qpsksig);

create a second data packet.

data = randi([0 3],moddims.datainputsize);
qpsksig = pskmod(data,4,pi/4);
txsig2 = ofdmmod(qpsksig);

concatenate the two packets and include an interval with no transmitted data.

txsig = [txsig1; zeros(112,1); txsig2];

apply i/q amplitude and phase imbalance to the transmitted signal.

rxsigiqimb = iqimbal(txsig,2,5);

apply phase noise.

rxsig = pnoise(rxsigiqimb);

measure and plot the evm of the received signal.

e = evm(txsig,rxsig);
tscope(e)

configure an evm object to output maximum evm, 90th percentile evm, and symbol count.

evm = comm.evm(maximumevmoutputport=true, ...
    xpercentileevmoutputport=true,xpercentilevalue=90, ...
    symbolcountoutputport=true);

generate random data symbols. apply 16-qam modulation. the modulated signal serves as the reference for the subsequent evm measurements.

data = randi([0 15],1000,1);
refsym = qammod(data,16,unitaveragepower=true);

pass the modulated signal through an awgn channel.

rxsym = awgn(refsym,20);

measure the evm of the noisy signal.

[rmsevm,maxevm,pctevm,numsym] = evm(refsym,rxsym)
rmsevm = 9.8775
maxevm = 26.8385
pctevm = 14.9750
numsym = 1000

measure the evm of a noisy 8-psk signal using two types of custom measurement interval and display the results.

set the number of frames, m, and the number of subframes per frame, k.

m = 2;
k = 5;

set the number of symbols in a subframe. calculate the corresponding frame length.

sflen = 100;
frmlen = k*sflen;

create an evm measurement system object, specifying a custom measurement interval equal to the frame length.

evm1 = comm.evm(measurementintervalsource="custom", ...
    measurementinterval=frmlen);

configure the object to measure evm using an 8-psk reference constellation.

evm1.referencesignalsource = "estimated from reference constellation";
evm1.referenceconstellation = pskmod(0:7,8,pi/8);

create an evm measurement system object, specifying a 500-symbol measurement interval with a periodic reset. configure the object to measure evm using an 8-psk reference constellation.

evm2 = comm.evm(...
    measurementintervalsource="custom with periodic reset", ...
    measurementinterval=frmlen);
evm2.referencesignalsource = ...
    "estimated from reference constellation";
evm2.referenceconstellation = pskmod(0:7,8,pi/8);

initialize the evm and signal-to-noise ratio (snr) arrays.

rmsevm1 = zeros(k,m);
rmsevm2 = zeros(k,m);
snrdb = zeros(k,m);

measure the evm for a noisy 8-psk signal using both objects. the snr increases by 1 db from subframe to subframe. the evm1 object uses the 500 most recent symbols to compute the estimate. in this case, the object uses a sliding window so that it processes an entire frame of data. the evm2 object clears the symbols each time it begins processing a new frame.

for m = 1:m
    for k = 1:k
        data = randi([0 7],sflen,1);
        txsig = pskmod(data,8,pi/8);
        snrdb(k,m) = k   (m-1)*k   7;
        rxsig = awgn(txsig,snrdb(k,m));
        rmsevm1(k,m) = evm1(rxsig);
        rmsevm2(k,m) = evm2(rxsig);
    end
end

display the evm measured using the two approaches. the windowing used in the first case provides an averaging across the subframes. in the second case, the evm object resets after the first frame so that the calculated evm values more accurately reflect the current snr.

stairs(snrdb(:),[rmsevm1(:) rmsevm2(:)])
xlabel('snr (db)')
ylabel('evm (%)')
legend('no reset','periodic reset')

figure contains an axes object. the axes object with xlabel snr (db), ylabel evm (%) contains 2 objects of type stair. these objects represent no reset, periodic reset.

generate filtered qam data and pass it through an awgn channel. compute the symbol error rate, and estimate the evm of the received signal.

create channel and filter system objects.

m = 16;
refconst = qammod(0:m-1,m);
channel = comm.awgnchannel( ...
    noisemethod="signal to noise ratio (snr)", ...
    snr=15,signalpower=10);
txfilter = comm.raisedcosinetransmitfilter(outputsamplespersymbol=4);
rxfilter = comm.raisedcosinereceivefilter(inputsamplespersymbol=4, ...
    decimationfactor=4);

create an evm measurement system object to calculate rms and maximum evm.

evm = comm.evm(maximumevmoutputport=true, ...
    referencesignalsource="estimated from reference constellation", ...
    referenceconstellation=refconst);

create an error rate measurement system object and account for the signal delay through the transmit and receive filters. for a filter, the group delay is equal to half of the filterspaninsymbols property.

rxd = (txfilter.filterspaninsymbols   rxfilter.filterspaninsymbols)/2;
errorrate = comm.errorrate(receivedelay=rxd);

perform these channel operations:

  • generate random data symbols.

  • apply 16-qam.

  • filter the modulated data through a raised cosine transmit filter.

  • pass the transmitted signal through an awgn channel.

  • filter the received data through a raised cosine receive filter.

  • demodulate the filtered data.

txdata = randi([0 15],1000,1);
moddata = qammod(txdata,m);
txsig = txfilter(moddata);
rxsig = channel(txsig);
filtsig = rxfilter(rxsig);
rxdata = qamdemod(filtsig,m);

calculate the error statistics and display the symbol error rate.

errstats = errorrate(txdata,rxdata);
symerrrate = errstats(1)
symerrrate = 0.0222

measure and display the received rms evm and maximum evm values. take the filter delay into account by deleting the first rxd 1 symbols. because the received signal contains symbol errors, the evm might not be totally accurate.

[rmsevm,maxevm] = evm(filtsig(rxd 1:end))
rmsevm = 17.2966
maxevm = 40.1595

measure the rms and maximum evm of a distorted ofdm waveform and visualize the received symbols by using a constellation diagram.

generate an ofdm waveform with 64-qam for random data.

m = 64;
nfft = 64;
nsym = 10;
cplen = 10;
data = randi([0 (m - 1)]',nfft,nsym);
txsym = qammod(data,m,unitaveragepower=1);
txwaveform = ofdmmod(txsym,nfft,cplen);

apply nonlinear distortion to the signal by creating a memoryless nonlinearity system object.

gain = 2;
nonlinearity = comm.memorylessnonlinearity(method="rapp model", ...
    lineargain=gain);
rxwaveform = nonlinearity(txwaveform);

recover the distorted symbols by performing ofdm demodulation.

rxsym = ofdmdemod(rxwaveform,nfft,cplen);

measure the rms and maximum evm per ofdm symbol of the received signal.

refsym = qammod((0:(m - 1))',m,unitaveragepower=1);
evm = comm.evm(maximumevmoutputport=1, ...
    referencesignalsource="estimated from reference constellation", ...
    referenceconstellation=refsym, ...
    normalization="average constellation power");
[rmsevm,maxevm] = evm(rxsym);
disp(rmsevm')
    8.0933
    7.4962
    7.7542
    7.7335
    7.5719
    7.9262
    7.7042
    8.6034
    8.0817
    7.6852
disp(maxevm')
   18.8246
   15.6412
   15.9905
   13.0713
   14.0164
   15.5771
   17.0201
   19.4699
   18.2106
   16.7549

visualize the received symbols on a constellation diagram.

constellation = comm.constellationdiagram( ...
    name="constellation diagram of received symbols", ...
    referenceconstellation=refsym(:));
constellation(rxsym(:))

algorithms

the implementation supports three normalization methods. you can normalize measurements according to the average power of the reference signal, average constellation power, or peak constellation power. different industry standards follow one of these normalization methods.

the algorithm calculates the rms evm value differently for each normalization method.

evm normalization methodalgorithm
reference signal

evmrms=1nk=1n(ek)1nk=1n(ik2 qk2)×100

average power

evmrms(%)=1001nk=1n(ek)pavg

peak power

evmrms(%)=1001nk=1n(ek)pmax

in these equations:

  • ek = ek=(iki˜k)2 (qkq˜k)2

  • ik is the in-phase measurement of the kth symbol in the burst.

  • qk is the quadrature phase measurement of the kth symbol in the burst.

  • n is the input vector length.

  • pavg is the average constellation power.

  • pmax is the peak constellation power.

  • ik and qk represent ideal (reference) values. i˜k and q˜k represent measured (received) symbols.

the maximum evm is the maximum evm value in a frame or evmmax=maxk[1,...,n]{evmk}, where k is the kth symbol in a burst of length n.

the definition for evmk depends on which normalization method you select for computing measurements. the implementation supports these algorithms.

evm normalization methodalgorithm
reference signal

evmk=ek1nk=1n(ik2 qk2)×100

average power

evmk=100ekpavg

peak power

evmk=100ekpmax

the implementation computes the x-percentile evm by creating a histogram of the incoming evmk values. this output provides the evm value below which x% of the evm values fall.

extended capabilities

version history

introduced in r2012a

see also

objects

blocks

topics

    网站地图