Matlab Toolbox for RF Receiver Modeling

In this paper a novel RF receiver modeling approach is presented. The novelty consists in the usage of the object oriented programming instead of the usual imperative programming. Classes were defined for entities as signal, non-ideality and RF/analog block, in order to achieve a basic RF receiver model. The main circuit non-idealities were identified, non-ideality parameters and their analytical models were encapsulated into classes. The effectiveness of the proposed modeling approach was demonstrated by developing in MATLAB a fairly complete model of a direct conversion receiver.


Introduction
The latest trend in wireless receiver development is the co-designing of the RF/analog front-end and the (usually digital) algorithms used to compensate the RF tuner non-idealities.Modern communication standards push ever higher both the carrier frequency and the channel bandwidth; as a result, the requirements imposed on the RF/analog blocks are more difficult to meet.In principle, this is (at least partially) mitigated by the usage of high-performance digital signal processing (DSP), including non-ideality compensation algorithms and error corrections.However, in order to assess the combined effect of RF/ analog block non-idealities and determine whether or not a given DSP is able to handle it, one needs very detailed modeling of both the RF & analog front-end and the DSP.
When modeling a modern communication standard transmission chain the imperative programming may not be the most suitable approach as the code may became unstructured, unreadable and hard to reuse.Following on this observation we propose the usage of object oriented programming (OOP) in order to achieve not only the accurate modeling of block-level nonidealities but also to enable a framework for transmission chain modeling.
This paper is organized as follows: the next section briefly introduces the direct conversion receiver (DCR) architecture, highlighting the main blocks within its structure; the third section comprises a brief description of the proposed toolbox classes; the fourth section describes the DCR model developed with this toolbox; finally, conclusions are drawn and a few possible directions for further developments are discussed.

The Direct Conversion Receiver
Let us first review the main blocks of the DCR architecture [ [1]], with the aim of identifying the main parameters/functions/limitations of the RF/analog blocks within the signal path of the receiver.
The classic DCR receiver structure is depicted in Fig. 1.The antenna collects the RF signal, which is passed through a band pass filter (BPF) that selects the band used by the communication standard.The filtered RF signal is amplified by the low noise amplifier (LNA).The amplified signal is multiplied with a complex carrier generated by the local oscillator, based on a voltage controlled oscillator (VCO).This multiplication is performed by a quadrature mixer (MIX); thus, the RF signal is down-converted into a complex base-band signal, further processed by the in-phase and in-quadrature (I/Q) signal paths: the low pass filtering (LPF) is needed to remove unwanted spectral componentsin particular the neighboring channels.The automatic gain control (AGC) block amplifies the filtered signal, now comprising mainly the wanted channel, to the full input range of the next stage, the analog to digital converter (ADC).
The main non-idealities affecting such a receiver are: the non-linearity and noise of each block within the signal paths, the phase noise of the local oscillator, the I/Q imbalance due to phase and gain errors in the complex carrier and mismatches between the I and Q baseband paths, the aperture and clock jitter in the ADC [ [2]].

Defined Classes
General Classes.Each class in the proposed toolbox was derived from the same parent class, called the BaseClass and having the diagram presented in Table 1.The aim of this class is to provide general functionalities that could be used in any derived class, for example the read and write of encapsulated properties.
The LNA, BPF, MIX, VCO and ADC are RF/analog blocks and these are communicating with the use of signals.Abstraction of the term signal leads to a class that includes properties (samples, sampling frequency, and center frequency) and methods (signal plot, arithmetic operations).The diagram of SignalClass is presented in Table 2.
Abstraction of RF/analog blocks leads to the definition of BlockClass.This class is derived from BaseClass too.The common RF/analog block parameters are the input impedance (Z in ) and output impedance (Z out ). BlockClass has a dedicated procedure, called add, to insert objects (class instances) into one of its field called architecture.Another important method is called process.This method can be used to implement the functionality of the blocks (amplification, filtering, mixing).The BlockClass is summarized in Table 3.  Nonlinearity class.Widely known parameters of the non-linearity found in the literature are: power gain, power at saturation P SAT , 1dB output compression point -OP1, third-order intercept point IIP3 [ [3]].The effect of non-linearity can be described as: where x(t) is the input signal, y(t) is the output signal and a k are real coefficients.Usually the third order component is considered only, so relation (1) becomes: (2) Equation ( 2) is the starting point for the abstraction of nonlinearity, conducting to NonliniarityClass (Table 4.).The coefficients a 1 and a 3 are properties of the class.Equation (2) does not contain the saturation that can occur in circuits, thus further fields for the input and output amplitude limit AI sat and AO sat , are computed using: ( Due to the facilities provided by the OOP it is possible the implement the automatic update of a 1 and a 3 coefficients whenever the property values of AI sat or AO sat are accessed (modified).The processing described by equation ( 2) is implemented in the method process.Thermal noise class.The electron flow in a resistance R operating at the temperature T generates a noise voltage; its value, integrated over the frequency range B, is given by: where k=1.38*10 -23 J/K (Boltzmann's constant).Thermal noise is present in each RF/analog block and its effect is described by: where n(t) is a random process with unitary power and normal distribution.This non-ideality is encapsulated in TermalNoiseClass (inspect Table 5 for the description of the class' fields).The noise figure (NF) of an RF/analog block expresses the degradation of the input signal to noise ratio (SNR) to output SNR.Thus the equivalent thermal noise (in Kelvin) of an RF/analog block can be computed from its noise figure (in dB): Phase Noise.The signal generated by the VCOs is not purely sinusoidal in a silicon implementation.A frequency synthesizer comprises a reference oscillatorusually crystal-basedand a phase locked loop, PLL; the PLL is consists of a phase detector, a loop filter, a voltage controlled oscillator and a divider with a given division factor.Even when the PLL is locked at the desired frequency, the inherent noise results in a slight variation of the phase of its output signal compared to the reference signal.
Several models for phase noise can be found in literature; they all agree that the effect of phase noise can be modeled as a phase modulation of the baseband signal: where Φ(t) is the time domain description of the phase noise.Many interpretation exists for Φ(t) [[4]].
A special case of the phase noise is the carrier frequency offset.In this case phase noise Φ(t) is considered to be a linear function of time Δft, where Δf is the frequency offset.Thus equation ( 7) is: Advanced Engineering Forum Vols.8-9  6) PhaseNoiseClass (Table 6) provides a mean for the user to give its own function for Φ(t).This is implemented by property field dedicated for a function handler.Method process will invite the specified function to generate the e jΦ (t) and multiply the returned value and the input signal.I/Q Imbalance (Mismatch).The I/Q imbalance is a problem common for both direct conversion and low-IF receivers.The orthogonality between the I/Q paths is easily compromised by the amplitude and phase errors in the complex carrier generated by a quadrature oscillator.It was shown in [ [5]] that the I/Q imbalance (in the case of a direct conversion receiver) will cause the superposition of the desired signals conjugate over the desired signal: where x(t) is a complex valued, (representing the in-phase and quadrature signals), * stands for conjugation, and coefficients are given by: where g is the amplitude and φ is the phase error.I/Q imbalance is measured using the image rejection ratio (IRR): Considering the wideband nature of the communications standards used nowadays I/Q imbalance should be considered frequency selective.Frequency selectivity is the result of the many processing stages in the RF receiver.The main contributors to frequency selective (FD) I/Q imbalance are the lowpass filters placed on the I/Q paths for desired band selection.Due to the physical implementation the LPFs' places on the in phase and quadrature paths are different, they have a deviation from their nominal values.Thus FD I/Q imbalance is modeled by: where h i and h q are the deviations from the LPFs nominal value.From (11) one can easily obtain: * '( ) ( ) ( ) 22 h gh e h gh e y t x t x t The diagram of the class created for the I/Q imbalance is presented in

Simulation Example
Let us consider the DCR architecture depicted in Fig. 2, with the parameters summarized in Table 8 [ [6]].For simplicity we considered all RF/analog block input and output impedances equal to 50 Ohm.One advantage of the OOP approach is a welldefined bounda-ry between the core model and support/add-on features such as graphical user interface.For example, it was an easy task to generate the tree view of the RF receiver architecture depicted in Fig. 2. The top level architecture contains a BPF, LNA, MIX, LPF and AGC objects.Each object is a container of selected non-idealities.E.g. the object MIX contains instances of nonideality classes (TermalNoise, Nonlinearity, IQImbalance and CFO.Beside these non-idealities the MIX contains properties as: Zin, Zout and signal. The input signal, depicted in Fig. 3a, consists of The amplified signal enters into the down-conversion stage carried out by MIX.CFO and I/Q imbalance are modeled in the mixer.The CFO is set for an exaggerated 1MHz and the IRR for 29 dB, in order to make these two effects visible in Fig. 4a.As one can see on the right side of the desired signal there is a side lobe, which is the combined result of CFO and I/Q imbalance.The MIX contributes with 15dB gain in the overall receiver chain.Fig. 4b is the desired signal spectrum after LPF.The LPF characteristics (6 th order Chebyshev type II) are depicted too in the figure.Finally the AGC amplifies the received signal to the ADC input range.

Summary
A MATLAB toolbox for modeling the non-ideality of RF/analog blocks was developed.The novelty of this simulation toolbox is the OOP approach in the creation of the toolbox blocks.This approach makes it easy to encapsulate non-ideality parameters and their effects in one entity.The usage of the toolbox accelerates the creation of RF receiver modeling, thus potentially accelerating the verification of various algorithms employed in wireless communication, such as I/Q imbalance compensation, CFO mitigation, etc. Future work will comprise: completion of the toolbox with harmonic image distortion model and ADC specific non-ideality models (quantization noise, aperture and clock jitter, nonlinearity); the implementation of automated performance
object constructor; the first argument contains the samples of the signal; the second and third argument stands for the sampling frequency and center frequency object= Constructor(signal) OOP allows polymorphism of functions; thus other constructor functions can be defined; this form takes as input argument an instantiation of SignalClass PlotPlotting the contained values.Advanced Engineering Forum Vols.8-9

Table 3 BlockClass diagram .
BlockClass inherits all the fields of BaseClass Field name Description Properties architectureField architecture is a structure that contains objects of BlockClass.With use of the procedure add (de below) an abject can be added to the architecture BlockClass and it will be added to the architecture field result=process(signal) signal is an object of SignalClass.The return value result is computed in the next way: the process function of objects inserted in field architecture are invited in the order they were added in the architecture passing the input signal from one to other.
Methods output=process(input) input and output are instances of SignalClass; this member executes the processing in equation (2) update(object)this member updates the values a1 and a3 of when aisat or aosat is accessed

502 Interdisciplinary Research in Engineering: Steps towards Breakthrough Innovation for Sustainable DevelopmentTable 5
TermalNoiseClass diagram.