Matlab code for an RC circuit with inout s Gaussian White noise voltage
clc
clear all
close all
t = 0 : 0.005 : 0.5; %Time
% Define the voltage source which is effected by Gaussian
Noise
Vs = 10;
Vsn=awgn(Vs,20); %Noise is in dbW awgn(input,snr)
C = 10e-6; %Capacitor
R = 5e3;
tau = R*C;
V01 = Vs * ( 1 - exp(-t/tau) ); %RC response of input signal
V0 = Vsn * ( 1 - exp(-t/tau) ); %RC response for AWGN effected
signal
plot(t, V01,'r',t, V0,'-+')
grid on
title('Transient Analysis - RC circuit')
xlabel('Time (s)')
ylabel('Voltage across capacitor (V)')
legend('Without Noise','AWGN effected signal')
Get Answers For Free
Most questions answered within 1 hours.