Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Moving average with convolution. Convolution is a widely used approach in signal processing. In this exercise we will apply a moving average filter using convolution.
Moving average with convolution. Convolution is a widely used approach in signal processing. In this exercise we will apply a moving average filter using convolution. a. We will consider a signal that runs from t=2 to t=2 with a time step h=0.01. The signal is a squared gaussian-modulated sinusoidal pulse Vpuls=gauspuls(t,1,0.6)2 b. Define the number of points in the moving average (a.k.a. the window size) as nAvg=31. c. Define the convolution kernel k as a vector with 1 row and nAvg columns. k should sum to 1 ; that means each element of k is equal to 1Avg. d. Convolve Vpuls (the Gaussian pulse signal from part 5) with k using the command vAvg=conv(Vpuls,k,same) vAvg is the resulting vector processed with a moving average, Vpuls is the signal to average, k is the convolution kernel, and 'same' indicates that length(vConv) = length(V). e. Plot both Vpuls and vAvg ( y-axis) against time ( x-axis) in the same figure. Make sure to add a legend and axi labels. Rolling window integration with convolution. The convolution kernel (k) defines how we process the signal and could be a moving average, bandpass filter, rolling integration, or many other options. In this exercise we will define the values of k in order to perform a rolling window integration on the signal Vpuls (defined in part 3). a. Define the number of points in the kernel nlnt =31 b. Based on the in-class derivation, the first and last element of k are equal to 0.5h, where h is the time step size. All other elements of k are equal to h. c. Convolve Vpuls (defined in part 3) with k using the same syntax as step 3. d. Plot Vpuls, vAvg, and vInt (y-axis) against time (x-axis). Make sure to include a legend and axis labels
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