%% Model LO Phase Noise
% A mixer transfers local oscillator (LO) phase noise directly to its
% output.
%%
% 
% <<../interference_phase_noise.png>>
% 
%%
% The preceding figure shows the transfer of phase noise from $f_{LO1}$ to
% $f_{IF1}$ .
%% Create Model with Phase Noise
% The model |ex_simrf_phase_noise| introduces phase noise into the
% model from the section |Create a Model with RF Interference|. The first
% mixing stage downconverts the RF and image to $f_{IF}$. To open the
% model:
open_system('ex_simrf_phase_noise')
%% View Simulation Output
% The model uses |Spectrum Analyzer| to generate 5 plots.
%%
% 
% <<../phase_noise_spectrum.png>>
% 
%%
% The Phase Noise spectrum scope shows a single-sided power density
% spectrum measuring the phase noise level at the LO1 source versus
% frequency offset shown in logarithmic scale.
%%
% The IF1 spectrum scope shows a power spectrum centered at the first
% intermediate frequency, measured between the first and second stages.
%%
% 
% <<../if1_spectrum_2.png>>
% 
%%
% The scope shows that the LO phase noise has been transferred to the
% image. The RF signal on the carrier $f_{IF1}$ is not visible in the figure
% because its power level is below the phase noise power of the
% downconverted image signal.
%%
% The Output spectrum scope shows the downconverted RF with the images
% removed.
%%
% 
% <<../phase_noise_spectrum.png>>
% 
%%
% The LO phase noise has been transferred to the receiver output.
%% Shaping LO Noise Skirt
% As seen in the phase noise scope, the added phase noise is pink (1/f) and
% is specified within the CW source LO1. Specifically, the Add phase
% noise checkbox is checked in the blocks parameters dialog:
%%
% 
% <<../CW_dialog_box.png>>
% 
%%
% The phase noise frequency offset and phase noise level variables
% PhNoOffsets and PhNoLevels are defined in the models PreLoadFcn callback,
% accessible through File > Model Properties > Model Properties:
%%
% 
% <<../model_callbacks.png>>
% 
%%
% The upper limit of the offset frequency is governed by the sample time
% and is limited to the envelope bandwidth of the simulation. The lower
% limit of the offset frequency is governed by the duration of the impulse
% response generating the phase noise frequency profile. Increasing the
% duration length in time steps from 128 to 256 will double the frequency
% resolution and allow simulation of the 1/f profile down to 250Hz (as
% opposed to the current lower limit of 500Hz). 

%% 
% Copyright 2012 The MathWorks, Inc.