Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider vectors of N time samples. In the time domain, the basis vectors , for n = {0, 1,..., N-1} have a 1 in
Consider vectors of N time samples. In the time domain, the basis vectors , for n = {0, 1,..., N-1} have a 1 in the n'h slot and a zero elsewhere. In that basis, a signal x[n] is written as an N-vector = x[n]n. V-1 n=0 Let's consider sinusoidal basis vectors b, for k (0, 1,..., N-1}. In order to write the vector in this new basis, we'll need to know the projection of these basis vectors onto the original basis vectors. Please assume that the projection of the new basis vector of index k onto the original basis vector with index n equals (n|bx) = e/2 and the projection the other way (from old basis vector to new basis vector) equals its complex conjugate (bxln) = te 2x#. We can use these projections to write by, the new basis vector with index k, in the original basis as the N-vector of time samples e/2x4 for n (0, 1,..., N 1}. Likewise, we can write original basis vector , as an N-vector in the new basis ase for k (0,1,..., N 1}. (a) Given a value of N, write a Python function that returns an NX N numpy array (matrix) where the kth column is the basis vector written as an N- vector in the original basis. (Note that this will be a matrix of complex numbers.) I will refer to this below as the inverse matrix. (b) Write a Python function that takes an N X N inverse matrix (where the columns are the new basis vectors as vectors in the original basis) and returns an NX N numpy array where the element in the kth row and ph column is the inner product (1)=bb. Examining the results for N = 4, are the sinusoidal basis vectors orthonormal? Explain. (c) Write another function that returns an Nx N numpy array where the column is the basis vector , written as an N-vector in the new, sinusoidal basis. (Note that this will be a matrix of complex numbers.) I will refer to this below as the forward matrix. Explain how the forward matrix is related to the inverse matrix. Examining the results for N = 4, what do you get when you matrix multiply these two matrices? (d) Let's take a time signal in the original basis and see what it looks like in the sinusoidal basis. Take N = 1024 samples of a 1 kHz sine wave with Amplitude A = 1, sampled at F, = 44, 100 Hz. Matrix multiply this signal by the forward matrix for N = 1024. The result will be a complex N-vector iva -convert it to dB using 20. * np. log10 ( np.abs(v)) and plot the result. Also pass the signal to np.fft.fft() to get the DFT of the signal to S and plot it using the same dB measure. Discuss what you find. Try using f = np.arange (N) * Fs/N in a plot of f (x-axis) vs. dB (y-axis). What do you find? What happens if you subract 10 np. log10 (N) from your dB curve computed using np.fft.fft() ?
Step by Step Solution
★★★★★
3.52 Rating (152 Votes )
There are 3 Steps involved in it
Step: 1
a Heres a Python function that returns an NXN numpy array matrix where the kth column is the basis vector bk written as an Nvector in the original basis python Copy import numpy as np def getinversema...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