No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Phase Noise

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.5 | 13 ratings Rate this file 33 Downloads (last 30 days) File Size: 9.67 KB File ID: #8844 Version: 1.0
image thumbnail

Phase Noise


Alex Bar-Guy (view profile)


27 Oct 2005 (Updated )

Oscillator Phase Noise Model

| Watch this File

File Information

function Sout = add_phase_noise( Sin, Fs, phase_noise_freq, phase_noise_power )
  Oscillator Phase Noise Model
      Sin - input COMPLEX signal
      Fs - sampling frequency ( in Hz ) of Sin
      phase_noise_freq - frequencies at which SSB Phase Noise is defined (offset from carrier in Hz)
      phase_noise_power - SSB Phase Noise power ( in dBc/Hz )
      Sout - output COMPLEX phase noised signal
      Input signal should be complex
   EXAMPLE ( How to use add_phase_noise ):
          Assume SSB Phase Noise is specified as follows:
       | Offset From Carrier | Phase Noise |
       | 1 kHz | -84 dBc/Hz |
       | 10 kHz | -100 dBc/Hz |
       | 100 kHz | -96 dBc/Hz |
       | 1 MHz | -109 dBc/Hz |
       | 10 MHz | -122 dBc/Hz |
       Assume that we have 10000 samples of complex sinusoid of frequency 3 KHz
       sampled at frequency 40MHz:
        Fc = 3e3; % carrier frequency
        Fs = 40e6; % sampling frequency
        t = 0:9999;
        S = exp(j*2*pi*Fc/Fs*t); % complex sinusoid
       Then, to produse phase noised signal S1 from the original signal S run follows:
        Fs = 40e6;
        phase_noise_freq = [ 1e3, 10e3, 100e3, 1e6, 10e6 ]; % Offset From Carrier
        phase_noise_power = [ -84, -100, -96, -109, -122 ]; % Phase Noise power
        S1 = add_phase_noise( S, Fs, phase_noise_freq, phase_noise_power );


This file inspired Microwae Engineering.

MATLAB release MATLAB 6.5.1 (R13SP1)
Other requirements -
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (22)
21 Jul 2015 Mayank Lakhani

Can anybody tell me, Why i cannot see the spreading of spectrum in frequency domain.

Fc = 3e3; % carrier frequency
fs = 40e6; % sampling frequency
t = 0:9999;
S = exp(j*2*pi*Fc/Fs*t); % complex sinusoi

Fs = 40e6;
phase_noise_freq = [ 1e3, 10e3, 100e3, 1e6, 10e6 ]; % Offset From Carrier
phase_noise_power = [ -84, -100, -96, -109, -122 ]; % Phase Noise power
S1 = add_phase_noise( S, fs, phase_noise_freq, phase_noise_power );

%%% first signal S
nfft = length(S);
res = fft(S,nfft)/nfft; % normalizing the fft
f = fs/2*linspace(0,1,nfft/2+1);% choosing correct frequency axes
res = res(1:nfft/2+1); % amplitude of fft(taking the half length of nfft)
figure, plot(f,abs(fftshift(res)));

%%% second signal S1
nfft = length(S1);
res = fft(S1,nfft)/nfft; % normalizing the fft
f = fs/2*linspace(0,1,nfft/2+1);% choosing correct frequency axes
res = res(1:nfft/2+1); % amplitude of fft(taking the half length of nfft)
figure, plot(f,abs(fftshift(res)));

Comment only
07 Oct 2013 wei wang  
26 Sep 2013 Frank Wang

I think the phase noise = 0dBc/Hz at freq offset of 0 Hz is not correct.

Comment only
10 Feb 2013 Mark

Mark (view profile)

great work Alex, thank you for sharing!

Comment only
10 Feb 2013 Mark

Mark (view profile)

12 Jan 2012 Ping

Ping (view profile)

I am eager to know, if the Fc is very high (e.g. 300MHz), does this code still work? I found a very strange waveform when I set Fc to a high frequency.

Comment only
12 Oct 2011 glacier w

thank you,it's my first time download codes here.thanks again.

11 Aug 2011 Kei Obara

I have below OFDM model;
FFT size = 64
Subcarrier spacing = 1e5(Hz)
Symbol duration = 1/subcarrier space = 1e-5(s)
duration of 1 data sample = 1e-5/64 (s) (IFFT data is coverted to serial and become1/64)

in this case, "Fs" in this program should be 1e-5/64 (s) ? or any other values should be used ?


20 Jun 2011 Pedram

Pedram (view profile)

Very good. Thank you. Is there anyway to increase the precision of the approximation? This method is valid only for low phase noise values. How can one produce higher phase noise values?

25 Feb 2011 Michal Eitan

i did tried the code- and tried to plot the single side phase noise in [dBc/Hz] units, but i got inncorrect values from what i wrote to the function.

Michael what did u mean by "M vs. (2*M-2)"?


18 Mar 2010 Michael

I like Alex's work!

However, I need to point out a minor bug in the code. I noticed that the phase noise I received from the code was higher than anticipated. Then I noticed on line 219 that the normalization is incorrect. Alex is correct in that (2*M-2) is needed to compensate for the inverse DFT; however this normalization (line 219) should be M vs. (2*M-2) since on line 222 he creates the two-sided spectrum by adding the negative frequency spectrum. In essence line 222 adds the rest of the normalization (M-2). Once I corrected this the phase noise I get is within 1 dB of anticipation vs. 6 dB.

Finally, there is a little mistake, which makes no difference in the result since the phase noise is generated via a random variable. However, to be numerically correct line 231 should have a -j vs. +j in the exponential.

12 Dec 2008 sia yousef

Hi I wonder how this model can satisfy the real shape of the oscillator that firs we have a 1/f^3 and then 1/f^2 and then noise floor.
and it doesn't have close to carrier phase noise.
I don't know how based on which model you generate phase noise?

Comment only
03 Dec 2008 xu zhenhua

xie xie

Comment only
02 Dec 2008 wendy

wendy (view profile)

how come i run this program but it says Not enough input arguments. ?

Comment only
06 Oct 2008 Nick A

This approach is very elegant. However, it limits the amount of low frequency phase noise extracted from the PSD by the original sampling frequency. Any ideas about circumventing this limitation?

18 May 2008 Agus Suhendar

i have problem, hope u can help me..
after qam mapping and ifft the signal is in time domain and complex form, with BW=7 MHz the problem is how to sampling the complex time domain signal with sampling factor=8/7 or Fs=8MHz
thanxs b4..

Comment only
20 Feb 2008 CT Lin

thank you

20 Feb 2008 chuntel Lin

thank you

Comment only
01 Aug 2007 john kedziora

Works very well!

19 Dec 2006 thomas höhne

Great work. Easy to adapt to own needs. The plot of the generated PSD could be done better.

14 Dec 2006 Madhukar Ramamurthy  
08 Nov 2006 Ming-Yu Hsieh

This model is very adequate for ofdm system.

Contact us