Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fill out when it say#TODO Comments: Note hov te con olution stretched out thg decaying ooonoritial! In oractice, wo often con't have access to closed

Fill out when it say#TODO image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Comments: Note hov te con olution "stretched out thg decaying ooonoritial! In oractice, wo often con't have access to closed form expression describing our impulse response. Insiead, we have a file with a measured vers on of our impulse response, which we can use for simulaing the action of an LTI system that we want to study For example, suppose you are in the busness of ohtaining high-precision measurements In theery, the perfect measurement system (suppnse it's an LTI sysler" } would ve l deIta as tsirripu se 'esponse srce convolv ng withaa delta does nothing. In pracfce you may be using an uso oscolue that llas-1 delta- liko impulsc response, sich as x2 . To study what iaturvs of a signal of intorest are modfod by the imperfections, you can model the oscilloscopc as an LTI system. record its impulse response, and then siulate the measuremant process in Python by convolving the signal of interest with your measured impulse response, studying all the relevant details of ine. This provides arica norpettation of this question in the ntext of takng measuremcnts an osciloscope doesnt have a pcrioctly narrow dota $1ts inpulse response, it has something more like , so whenever we measure something, we're realy getting amore "stretched out verion of it! In some cases, this idea of convolution aa 'smearing one signal across time with another is a very useful interpretation. Q3: Filtering Now t at you're acquanted wih Python and numpyimatplotlib a things! wel as comput ng convolution in numpy, we can put our skils to doing some more interest ng In this question, we'll explore two classic nitees: the ID edge detector, and the moving average, Yuve seen both of thasenn-w 1 so in this prooiern, wel move beyond merc conccptuul unders anding and locus o exploring wtil they do n ht contex of a.ctual tis, es e y deld that is cumborso nc to ars rze wth pencil and paper. Thoso aro both LTIsystome, so wo'l spcak of thom in torns of thoir impulso rosponscs. The 1D Edge Detector The 1D edge detector is used in signal processing to, as you may have guessed from the name, detect edges, or jumps in a signal's amplitude. It's referred to as 1 D to distinguish it from 2D e detecting fllteused inimage procenting ban c signala only containing amplitude verous time info mason are re e med to as "1" whereas imacges are often considered as 20 signals. Other than the Deconvolution lab, where well briefly touch on some hasic image processing, all sgnals you'll sce in EE 120 l be 1D The impulse response of a 1D edge detector is defined as Tho r ltor works by taking 2 dirte on o betwoon ovory pair of ud a cont signa valuos " zoros, as thore's no 'edg ou havu asee uence, o constant valu s, the Etor ws. ropou cty output Simlarly, it the signal has a zero (at tme n 1)followed by a 1 (at time n), the iler will dput a 1 (at tien), indicating an edge e1. The fiter also encodes information ut out the odgo's drodon if you .nstoad hud 1 (ot time " I } followed bya O (ut timen the output (art tirnu n' would bo 1 Becauso of this tho 1 D edge detector can be thought of as the discrete-time equivalent of taking derivatve Piecewise Constant Signals we'lgo through two taxamples wh ths 'iter. First, we'll try t out on a pitturwise. nstant constant-hcight segments oach sproad oor more than one sample. ipal. We t al a DT sic pie'zwse 1an' i' l tons sts only o' Piecewise Constant Signals We'l go througn two examples this riite. F st, well tryit out on a pie ewese constar signaal we call a DT signal constant-height sogments each spread over more than one sample. ete se constat if it ons sts only of In thet cel' below, ining the time dies n the piocowise conslanl signalxas follow { 10, 9, . . . , 1,11, 1 . . . , 9, 10), define your ID edge detector's impulse response as FD. Add tionally, def e Finally, apply your edge detector ED to xby consolving them, us ng the 'same mode (note we have ample zero padding here, so this is fne). Plotting code has been provided for yeu, Simply run the cel when cone, We'l cal heillered result y Make sure to answer the questions below the cell. Yau can do this by double-clicking the cel wih text in it, and typing in your answer. Press Shift+Enter while focused on that cell after you're done typing to return it to normal. Tn [ ]: Ist TODO STGNAI AND TTHE TNDTCFS DFFTNTTTONS HERE n time indices ED- edge detector impulse response x test sigat T000 FILTERING CODE HERE y- filtered version of x Plot results plt.figure(figsize-(16, 8)) pit-subplot (2, 1, 1) plt.stem(n, x) plt.ylim(, 3.51) plt.titlePiecewise constant signal Sx(n)s") pt.subolot(2, 1, 2 plt.stem(n, y) plt.ylim(C-2.5, 2.5]) plt, title("1D tdge Detector Output for [n]S") plt.show() Question 1a: ts a piecewise-constant signal. How mamy times does the actual constant change? Don't count the change from not existing to zero at the start (or at the end A: (TODO) Question 1b: How many ports of the edge detector's output are nonzero {that is, how many edges are detected)? A: (TODO) Question 1OPTIONAL): One of the hottest areas of signal processing in the past ~15 years has been the study of sparse mostly zero) signals, including both acquisition and representation. Suppose you have a piecewise-constant signal, which you want to sparsity (le., make mostly zero) into another signal, from which you can still recover the original. How would you do so by only saving one of the original signal values and applying Edge Detecting Noise Now that weve tried our edge detector on a piecewise constant signal, lers try it on aless well-behaved signal: some noise! In this part, as well as the moving average filler, we'll use wat's commonly refered lo as Gaussian ise" as our tesl signal. What is this "nolse" you speak of? In many real-world applications, when using some data that has been collected (, a signal), ycu don't have access to the orginal signal (call it) Instead. you have accesso x = x +where z s ..noise. that comupts the signal. A large part of signal proceasing machine learning. statstics, data science, and many oner application areas Involves extracting as much meaning as possible trom the measured signal A popular choce or modeling , which we'll explore more in the lab on Orthogonal Signaling later in the semester, is whats known as 'Gaussitan noke" The name comes rom the fact that the noise itselt is ransom and so it hits to be craw fron, some proba ility distribution, which in this case is thGaus kn distitu on. Dont worry about the specofics of this-oudont need to w probability theory for this dass. But due to the popularity of he Gaussian noise model in signal processing, it's worth experimenting with as a test signal Weluse the time indices)...-1,, 1. The signal noise s derined tor you already tor these indioes FIll in the coce to generate the time indkes, regenerate your new impulse response tor these time indices, and Tinally apply your edge detector again, use the "same mode for conwclution, con worry aboul any padding issues). Run the cell when done te plot the resul Hint: You should use numpy functions, rather than writing out the 201 values by hand. for defining the edge delector impulse response. The functions np.ones np.zeros, and np.cancatenate may be of use. Wel pot in continuous ne as it beller llustrates the conoept tn [ ]; noise-np.random.norma1(, 1, 201) # TOOO: TIME INDICES # J000: NE06 DSRH SE RESPONSE T000: FILTERING CODE noise filt - Plot results plt.figure(figsize (12, 5)) plt.plot (n, noise) pltplot (n, noise filt) plt.xlim

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago