Question: We are often asked to confirm that a given filter design has the intended effect. This is often achieved using MATLAB or numpy ( or
We are often asked to confirm that a given filter design has the intended effect. This is often achieved using MATLAB or numpy or any similar computational environment using a white noise signalone that approximately contains all valid frequencies at approximately the same amplitude. In practice, we can generate this using a random number generator that produces random values between and in MATLAB this would be randshifting it to have a mean of zero ie subtract from all values, such that the mean is and, therefore, passing the resultant zero
Page of
BME C
Sensing and Measurement
Summer
mean signal through the convolutional kernel, and then evaluating how the frequency spectrum of the output differs from that of the input. We will here evaluate your filter from Problem in this manner.
a First, use rand or whatever is appropriate for your computational tooll to generate a sequence of at least random values having a zero mean. If you are using MATLAB, just subtract from all values in the vector!
b Use fft and fftshift to plot the magnitude of the frequency spectrum for your noise signal ie what you generated in part a To make this a truly useful spectrum, you will want to use eftshift as well as to define an axis scale to use with plot. For this latter, recall that in an point DFT the value corresponds to here taken to be kHz and the value at corresponds to onehalf this value. Assuming you did not limit the length of the FFT performed, you should now have at least values that are to be mapped to encompass fin Note that this particular range assumes you have used fftshift. Once you do have a magnitude spectrum that covers fin confirm the spectrum is "flat" in the sense that there is not a clear low high or bandpassreject structure. If so rerun your random sequence generation process...you just got unlucky, which is improbable, but NOT impossible
c Convolve your noise signal with the convolutional kernel you generated in Problem If you are using MATLAB, be sure to use the 'same' option with conv to trim the result to match the length of the noise signal. Similar options exist in other computational environments!
d Plot the magnitude of the frequency spectrum for your filtered signal. To make this a useful spectrum, you will once again want to use fftshift and define an xaxis. Once you have achieved an effective plot of the output frequency spectrum, compare the spectrum with that obtained in part b and confirmrefute that the passband corresponds to the targeted range of frequencies.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
