Click4Ai

546.

Medium

Noise Reduction

In audio signal processing, noise reduction is a crucial step to improve the quality of recorded audio. Given a noisy audio signal, implement a function to apply noise reduction using the NumPy library.

Example:

Suppose we have a noisy audio signal represented as a 1D NumPy array. We want to apply noise reduction to remove the background noise.

Constraints:

  • The input audio signal is a 1D NumPy array of floating-point numbers.
  • The noise reduction function should return a new NumPy array with the same shape as the input.
  • Test Cases

    Test Case 1
    Input: [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]
    Expected: [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
    Test Case 2
    Input: [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]
    Expected: [[8.0, 8.0, 8.0], [10.0, 10.0, 10.0]]
    + 3 hidden test cases