Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need Help with Python HW for Computational Physics Help with a High pass filter circuit problem Before asking for references please at least look at
Need Help with Python HW for Computational Physics
Help with a High pass filter circuit problem
Before asking for references please at least look at the jupyter notebook files at the drive links below: Problem 3: Need help understanding how to get the transfer function and the response at k = 0.2
The Fourier Series Expansion Using k again, but in a different way than the frequency. This k is the frequency of sinusoids that are being used as the basis vectors. This k goes from 0 (DC) 1 (the lowest complete sinusoid that fits in N) all the way up to N/2 (the highest frequency sinusoid, ie, Nyquist). There are N/2 such basis vectors, and each vector has an even and odd part for a total of N data points. This can be kept in N/2 on coefficients (C imaginary), or in N/2 an and bn coefficients. Or in the case of a cosine transform in N an coefficients The discrete Fourier series expansion (the inverse transform) is: Un = > CK exp( 2akn N where ca is scaled to become the correlation coefficient is N-1 CK = - N _ yn exp (-i Liken The requirement to keep f(x) real is: CK = ck, im(c_*) > 0 The form of the real cosine and sine transform is exactly equivelant to the complex for FOR REAL FUNCTIONS ONLY: fn = an + _ axcos ( ) + basin (2xkn where OK = Ck + c* and be = (ck - cp)i In [ ]: import numpy as np from numpy import pi import matplotlib. pyplot as plt N=1000 n=np . arange (N) ck=np. zeros (N, complex) # f = 2, 3, 10, 60, and 106. fn=np. sin(2*pi*n/N) +mp. sin(3*2*pi*n/N)+mp. sin(10*2*pi*n/N)+mp. sin(60*2*pi*n/N)+mp. sin(100*2*pi*n/N) pit . plot (n, fn) In [ ]: #DFT for k in np. arange (@, N) : sumck=0j for n in np. arange (6, N): sumck+=fn[n] *np. exp(-1j*2*np. pi*k*n/N) ck [k ] =sumck/N n=np . arange (@, N) pit . plot(n, abs(ck) )A time domain Finite Impulse Response FIR filter with size M (odd) is of the form: M/2 y(n) = [ h(n - m) * x(m) This is the convolution of h and x An Infinte Impulse Response (IIR) filter is of the form "( n) = > h(n + -m) * x(m) + b_ly(n - 1) + b_zy(n - 2)+.... In [ ]: The function X(m) = @"the is the eigenvector to differentiation (or discrete difference), integration, and translation. In light of the sampling function, it clearly makes sense to limit k to the interval (0,-5). The eigenvector / eigenvalue equation can be used to get the frequency response of a system transfer function by direct substitution and solving for h(w). In [ ]: ## a avg filter From numpy import * from matplotlib import pyplot as pit N=50 n=arange (6, N) xn=random. randint (0, 10, N) x5=xn #save pit. plot (n,xn, 'r' yn=zeros (N) M=5 ce=1/M C1=1/M C2=1/M c3=1/M c4=1/M for k in arange (0, N-M) : yn[k]=co*xn[k]+c1*xn[k+1]+c2*xn[k+2]+c3*xn[k+3]+c4*xn[k+4] pit . plot(n, yn, 'b' ) #second order: xn=yn for k in arange (@, N-M) : yn[k]=co*xn[k]+c1*xn[k+1]+c2*xn [k+2]+c3*xn[k+3]+c4*xn[k+4 ] pit . plot(n, yn, 's' ) #third order: xn=yn for k in arange (@, N-M) : yn[k]=co*xn[k]+c1*xn[k+1]+c2*xn[k+2]+c3*xn[k+3]+c4*xn[k+4 ] pit. plot(n, yn, 'k' ) pit . show( )In [ ]: # as a double sum: on=([co, cl, c2,Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started