# HW1S - ps2_2c.m ps2_2d.m ps2_2e.m ps2_2f.m clear all close...

This preview shows pages 1–3. Sign up to view the full content.

ps2_2c.m , ps2_2d.m , ps2_2e.m , ps2_2f.m clear all; close all; % Number of realizations N=1e6; % Std deviation of instrument noise sigma_g=2; % Instrument noise (complex I/Q form) Noise=(randn(N,1)+j*randn(N,1))*sigma_g; % Take the absolute value (envelope) Env_Noise=abs(Noise); % First figure out mean and standard deviation of Monte Carlo noise n_mu=mean(Env_Noise); n_std=std(Env_Noise); % Student's formulas #1 m2 =???; s_mu =???; s_std=???; display('Means') [n_mu s_mu] display('Standard deviations') [n_std s_std] clear all; close all; % Number of realizations N=1e6; % Std deviation of instrument noise sigma_g=2; % Instrument noise (complex I/Q form) Noise=(randn(N,1)+j*randn(N,1))*sigma_g; % Take the absolute value (envelope) Env_Noise=abs(Noise); % First figure out mean and standard deviation of Monte Carlo noise n_mu=mean(Env_Noise); n_std=std(Env_Noise); % Student's formulas #1 % m2 =???; % s_mu =???; % s_std=???; % % display('Means') % [n_mu s_mu] % display('Standard deviations') % [n_std s_std]

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
% Create a histogram of our N realizations [NN x]=hist(Env_Noise,100); % Spacing of histogram bins dx=x(2)-x(1); % Normalize histogram so that it integrates to 1 (as a pdf) mc_pdf_noise=NN/N/dx; % Student's formula #2 % Above envelope is supposed to have a pdf given by: ana_pdf_noise=???; % Make a plot to compare Monte Carlo and analytical pdf's figure(1) set(gca,'Fontsize',13) plot(x,mc_pdf_noise,'x','markersize',10,'linewidth',2) hold on plot(x,ana_pdf_noise,'r','linewidth',2) xlabel('Voltage Envelope') ylabel('Pdf') legend('Monte Carlo','Analytical') grid on clear all; close all; % Number of realizations N=1e6; % Std deviation of instrument noise sigma_g=2; % Instrument noise (complex I/Q form) Noise=(randn(N,1)+j*randn(N,1))*sigma_g; % Take the absolute value (envelope) Env_Noise=abs(Noise); % First figure out mean and standard deviation of Monte Carlo noise n_mu=mean(Env_Noise);
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 10/28/2009 for the course ECE 714 taught by Professor Johnson,j during the Spring '08 term at Ohio State.

### Page1 / 7

HW1S - ps2_2c.m ps2_2d.m ps2_2e.m ps2_2f.m clear all close...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online