BPNMmatlab

BPNMmatlab - Example Matlab Files for HW4 Problems 3 and 4...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Example Matlab Files for HW4 Problems 3 and 4 %%%two tone test simulation t=2*pi*[1:256]/256; A=0; %%% A is input power in dBm %%% We assume the input tones are separated by %%% f2-f1=2 ; then (f1-f2)/2=1 is modulation frequency w=2*cos(t); z=20*log10(abs(w))+A; %%% z is the input envelope, in dBm %%% We assume that there are functions gain1(x) and phase1(x) %%% that compute the gain and phase for a given %%% input, expressed in dBm for i=1:256 y(i)=w(i)*10^((A+gain1(z(i)))/20)*exp(j*phase1(z(i))*2*pi/360); end yfft=2*fft(y(1:256))/256; pyf=20*log10(abs(yfft)); plot(pyf(1:64)); 'P1=' pyf(2) %%% this is the fundamental output in dBm 'IM3=' pyf(4)-pyf(2) %%% this is the 3rd order intermod in dBc relative to P1 'IM5=' pyf(6)-pyf(2) %%% this is the 5th order intermod in dBc relative to P1 end %% examples of table based functions function y=gain2(x) %%% table based amplifier gain function %%% expresses gain in dB as function of input in dBm %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% z=x;
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

BPNMmatlab - Example Matlab Files for HW4 Problems 3 and 4...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online