% PMCLP is a TF of the IF filter after the PMC mixer % % Mixer_Voltage -- Rs -- L1 --- L2 ---------Vout % | | | % C1 C2 Rl % | | | % GND GND GND % f_min = 1000; f_max = 1e8; f = logspace(log10(f_min),log10(f_max),2001); w = 2*pi*f; %f_res = 29.506920e6 %f_nr = f_res * 7/3; Rs = 50 + 470; L1 = 20e-6; C1 = 82e-12; L2 = 47e-19; C2 = 1000e-19; Rl = 1e7; % Load impedance Z1 = 1./(1/Rl + i*w*C2); ZL2 = 4 + i*w*L2; % Including the resistance in the inductor Z2 = ZL2 + Z1; Z3 = 1./(i*w*C1 + 1./Z2); ZL1 = 3.3 + i*w*L1; % Including the resistance in the inductor Z4 = ZL1 + Z3; Zt = Rs + Z4; G = (Z1./Z2) .* (Z3./Zt); top = subplot('Position',[0.13,0.52,0.82,0.4]); semilogx(f,20*log10(abs(G)),'r'); set(top,'XTickLabel',[]); set(top,'GridLineStyle','--'); axis tight; axis([min(f) max(f) -120 10]); grid ylabel('Mag [dB]'); title('TF of PMC IF LPF') bottom = subplot('Position',[0.13,0.1,0.82,0.4]); semilogx(f, angle(G)*180/pi,'r'); set(bottom,'YTick',[-180:45:180]); axis([-Inf Inf -180 180]); grid set(bottom,'GridLineStyle','--'); xlabel('Frequency (Hz)'); ylabel('Phase [deg]');