Skip to content

Design and Validation of a Customizable 50th-Order Low-Pass FIR Filter. Transitioning from MATLAB Modeling to Verilog RTL Design and simulation Testing.

Notifications You must be signed in to change notification settings

basemhesham/Digital-Design-of-FIR-Filter-Transposed-Structure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Digital-Design-of-FIR-Filter-Transposed-Structure

This repository presents digital design for a low-pass FIR filter. Leveraging the filterDesigner tool in MATLAB, we meticulously crafted a 50th Order FIR Low Pass Filter utilizing the Hamming windowing method.then we extracted the filter coefficients and meticulously implemented the design using the Verilog description language. This design has undergone rigorous simulation on VIVADO to ensure its efficacy and accuracy.

Introduction

An FIR (Finite Impulse Response) filter is a type of digital filter used in signal processing. It operates by convolving a finite-length input signal with a series of coefficients, which are typically called the filter taps. These coefficients determine how the input signal is weighted and combined to produce the output signal. FIR filters are is widely used in different applications such as biomedical, communication and control due to its easily implementation, stability and best performance. Its simplicity makes it attractive for many applications where it is need to minimize computational requirements.

FIR Direct architecture

Digital filters are implemented using the basic building block elements of adders, multipliers, and shift registers. How these elements are arranged and interconnected defines a filter ’ s architecture. In general, a given filter can have multiple architectures that can be used to implement a common transfer function.

Fig1m5182018

FIR Transposed architecture

Another baseline FIR architecture is called the transpose FIR, which is a variation of the direct architecture theme. An FIR, with an impulse response β„Ž[π‘˜]={β„Ž_0 , β„Ž_1 , . . . , β„Ž_(π‘βˆ’1)} can be implemented as the transpose architecture shown in the following Figure

Comparing with the direct form we observe that the order of the filter coefficients is reversed, And the input reaches all the multipliers at the same time This is in contrast to the direct form structure where a given input sample reaches the multipliers at different clock cycles.

Fig8m5182018

Filter Specifications

we will design an audio lowpass filter that operates at a sampling rate of 44.1kHz which are standard sampling rate for audio applications. Let's say you want to design a FIR LPF for audio signal processing with a cutoff frequency of 4 kHz. We must also specify the word length of the coefficients, which in this case is 16 bits, assuming a 16-bit fixed-point DSP is to be used. We can design FIR LPF using various methods such as windowing, frequency sampling, or optimization techniques. The filter length and the coefficients will depend on the specific design method you choose and the desired filter characteristics. We will use window method in our design. img2

  • Filter Type: Lowpass
  • Sampling Frequency: 44,100Hz
  • Cutoff Frequency: 4,000Hz
  • Word length: 16-bits

MATLAB Modelling

Now we can design our filter based on the previous specifications using Filter Designer tool by the following command: filterDesigner MATLAB GUI

Magnitude and Phase Response

phase and magnitude response

Pole-Zero Plot

pole-zero plot

Filter Coefficients

The following step is to get the filter coefficients from File>Export>Coefficient File (ASCII) and choose decimal format.

filter coefficients

Convert coefficients from decimal to binary

To represent floating number in binary we use python script "floating_binary.py" truncate the numbers to just the 7 digits after the decimal point and write the new values after truncated then converted it to binary.

Generating Noisy Signal

This MATLAB script generates a noisy signal by adding random noise to a clean sinusoidal signal. the script first calculates the power of the noise based on the specified SNR, and then generates Gaussian noise samples with that power to add to the clean signal.

matlabsignal

Simulation

After the fifty-clock edge, we have the output: [ y(n) = b_{50} x(n-50) + b_{49} x(n-49) + \ldots + b_2 x(n-2) + b_1 x(n-1) + b_0 x(n) ]

Test case 1

data_in : noisy signal = (sin⁑(2πœ‹βˆ—1000βˆ—π‘‘) + noise)

data_out : filtered signal = sin⁑(2πœ‹βˆ—1000βˆ—π‘‘)

simulation1 We can notice that the original signal is recovered successfully with an acceptable delay that was expected due to the filter hardware stages.

Test case 2

data_in : signal with two frequencies = sin⁑(2πœ‹βˆ—1000t) +cos⁑(2πœ‹βˆ—20000t);

data_out : filtered signal = sin⁑(2πœ‹βˆ—1000t)

simulation2 We can notice that the frequency 20KHz is filtered and frequency 2KHz is passed

Test case 3

data_in : signal with two high frequencies = sin⁑(2πœ‹βˆ—8000t) + cos⁑(2πœ‹βˆ—20000t);

data_out : filtered signal β‰ˆ0

simulation3

We can notice that the both frequencies 20KHz and 8KHz is filtered

Test case 4

data_in : sin⁑(2πœ‹βˆ—1000t)

data_out : the same signal =sin⁑(2πœ‹βˆ—1000t)

simulation4

We can notice that the frequency 1KHz which is below cutoff frequency is passed

About

Design and Validation of a Customizable 50th-Order Low-Pass FIR Filter. Transitioning from MATLAB Modeling to Verilog RTL Design and simulation Testing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published