Noise Reduction using Filters

--

To explore more, check out my website :-<https://mein-bhi-engineer.com>

Connect with me on LinkedIn:-< https://www.linkedin.com >

Noise reduction is the technique involved in extraction of the desired information from a signal.The received signal is usually a mixture of information and noise. It is important to reduce the attenuation caused by random noise, since it produces the errors in information and lowers quality of the signal. One of the most challenging problems in digital signal processing is to extract the original information from a signal without any loss.

The filter is a device which shapes the signal waveform in a desired manner. The main purpose of filters in digital signal processing is to reduce the noise which improves the performance of the signal and to extract the desired information from the signal. There are many different types of filters that are used to reduce the effects of noise. Like a low pass filter which takes the lower frequencies and rejects the higher frequencies, the FIR filter which allows low frequency components. These types of filters have been proposed to improve the accuracy and efficiency of the information signal.

PROJECT : -

With the development of communication technology, voice communication has become a major communication media for people to transmit information more convenient. Audio noise reduction system is the system that is used to remove the noise from the audio signals.

In this project we will see how how noise can be reduced from a signal. For this purpose we will generate a Sinusoidal Wave ( Signal), add noise to it, design a filter based on our requirements and finally filter noise.

Flowchart of the Process
  1. Input audio file: — An input signal, audio file is uploaded in the ‘.wav’ format or a sinusoidal wave is generated.
  2. Add noise: — In electronics, noise is an error or undesired random disturbance in an electrical signal, turning the useful information signal into a corrupted one. Noise generated by electronic devices varies greatly as it is produced by several different effects. Here noise is added to the original signal. This makes the signal of low quality i.e. corrupted.
  3. Spectral Analysis:-The process of determining the frequency contents of a continuous-time signal in the discrete-time domain is known as spectral analysis. Spectral analysis is done based on either parametric or non-parametric methods. Non-parametric methods are based on dividing the time-domain data into segments, applying Fourier transform on each segment, computing the squared magnitude of the transform, and summing and averaging the transform. Non-parametric methods such as modified period gram, Bartlett, Welch, and the Blackman-Tukey methods, are a variation of this approach. Parametric methods are model-based approaches. The model for generating the signal can be constructed with a number of parameters that can be estimated from the observed data. From the model and estimated parameters, the algorithm computes the power spectrum implied by the model.
  4. Design Butterworth filter:-The Butterworth filter is a type of signal processing filter designed to have a frequency response as flat as possible in the pass band. It is also referred to as a maximally flat magnitude filter.
  5. Noise cancelled signal: — After noise is filtered out, signal is reconstructed. The reconstructed signal can only be like the original one, it can never be the same.

MATLAB CODE : -

clc;

close all;

clear all;

%

%% simulate noisy signal

f = 10;

Fs=500;

n = [1/Fs:1/Fs:1];

x = sin(2*pi*f*n);

% add noise to the signal

y = x + rand(1,length(x));

% plot the noisy signal

subplot(2,2,1);

plot(n,y);

title(‘Noisy Signal’);

xlabel(‘Time (s)’);

ylabel(‘Amplitude’);

%% Spectral analysis of the signal

L = length(y);

NFFT = 2^nextpow2(L);

y_fft = abs(fft(y,NFFT));

% creating frequency axis

freq = Fs/2*linspace(0,1,NFFT/2+1);

% Plot single-sided amplitude spectrum.

subplot(2,2,2);

plot(freq,y_fft(1:NFFT/2+1));

title(‘Single-Sided Amplitude Spectrum of y(t)’);

xlabel(‘Frequency (Hz)’);

ylabel(‘|Y(f)|’);

%% Design Filter and apply on the sequence

z = 5;

wn = [3 7]*2/Fs;

[b,a] = butter(z,wn,’low’);

% see frequency response of the filter

[h,w] = freqz(b,a,1024,Fs);

subplot(2,2,3);

plot(w,20*log10(abs(h)));

title(‘Magnitude Response of the Filter’);

xlabel(‘Frequency (Hz)’);

ylabel(‘Magnitude’);

grid on;

% Filter the signal

y_filt = filter(b,a,y);

subplot(2,2,4);

plot(n,y_filt);

title(‘Filtered Signal’);

xlabel(‘Time (s)’);

ylabel(‘Amplitude’);

IMPLEMENTATION DETAILS : -

1. Sampling frequency and signal frequency is defined as 500Hz and 10Hz respectively.

2. Time range ’n’ is defined from 0 to 1 sec with the interval of 1/Fs is defined.

3. Sine wave is generated, x=sin (2*pi*f*n).

4. A random signal of length same as that of the sine wave is generated and is considered to be noise.

5. Noise is added to the generated sine wave. The wave becomes distorted.

6. To define in FFT format, the command ‘abs’ is used to find magnitude of noise corrupted signal and linspace is used to find to find frequency .

7. The Magnitude and phase is analyzed and the graph is plotted to find frequency.

8. Order of filter is defined from the ‘magnitude response of filter’ graph and cutoff frequency is also obtained from the same graph.

9. Using the frequency Butterworth low pass filter is designed.

10. Filtered output is obtained

OUTPUT WAVEFORM : -

Generated sinusoidal wave (original signal)
Sampling frequency= 500 Hz and Signal frequency= 10 Hz

Project Outcomes:-

Noise distorts the original signal. To reduce the attenuation caused by random noise, filters can be used. The signal reconstructed after the filtering process will be free of noise to some extent. But it will not be the same as the original signal. By adjusting the sampling rate, better refinement can be achieved.

--

--

Abhijnan Prakash (Mein bhi Engineer)

Words weaved with passion, thoughts crafted into ink. Join me on a voyage of insights to explore the realms of knowledge together. Welcome to my world of words.