write my assignment 17373

Exercise 4 — Signal SmootherAn audio signal is sometimes stored as a list of int values. The values represent the intensity of the signal at successive time intervals. Of course, in a program the signal is represented with an array.Often a small amount of noise is included in the signal. Noise is usually small, momentary changes in the signal level. An example is the “static” that is heard in addition to the signal in AM radio.Smoothing a signal removes some of the noise and improves the perceptual quality of the signal. This exercise is to smooth the values in an integer array.Say that the original values are in the array “signal”. Compute the smoothed array by doing this: Each value smooth[N] is the average of three values: signal[N-1], signal[N], and signal[N+1].For the first element of smooth, average the first two elements of signal. For the last element of smooth, average the last two elements of signal.Use integer arithmetic for this so that the values in smooth are integers.import java.io.* ;class Smooth{ public static void main ( String[] args ) throws IOException {int[] signal = {5, 5, 4, 5, 6, 6, 7, 6, 5, 4, 1, 4};int[] smooth// compute the smoothed value for each// slot of the array smoothsmooth[0] = smooth[ signal.length-1 ] = for ( ){}// write out the inputfor ( int j=0; j < smooth.length; j++){}// write out the resultfor ( int j=0; j < smooth.length; j++){} }In interpretting the results, remember that integer division discards the remainder. It does not compute a rounded value. Here is a sample run of the program:C:>java Smoothsignal: 1 5 4 5 7 6 8 6 5 4 5 4smooth: 3 3 4 5 6 7 6 6 5 4 4 4C:>

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

Comments are closed.

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp