Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 ) { int[] signal = {5, 5, 4, 5, 6, 6, 7, 6, 5, 4, 1, 4}; int[] smooth // compute the smoothed value for each // cell of the array smooth smooth[0] = smooth[ signal.length-1 ] = for ( ) { } // write out the input for ( int j=0; j < smooth.length; j++) { } // write out the result for ( int j=0; j < smooth.length; j++) { } } } 

In interpreting the results, remember that integer division discards the remainder. It does not compute a rounded value.

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

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

What can Chandra do to correct her mistake?

Answered: 1 week ago

Question

=+4 How did it affect HR?

Answered: 1 week ago