Giter VIP home page Giter VIP logo

mahima8178 / application_of_fft_with_fir_filter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saadia-hassan/application_of_fft_with_fir_filter

0.0 0.0 0.0 1.12 MB

This project will walk you through the importance of Fast Fourier Transform (FFT) which is one of the major computation techniques in the world of Digital Signal Processing (DSP). It also explains how 'Filter Design Toolbox' can be made use of in MATLAB to design desired filters on the go.

MATLAB 99.98% HTML 0.02%

application_of_fft_with_fir_filter's Introduction

Application of FFT with FIR filter

The only motto of this project is to make one understand how Fast Fourier Transform can be used in the simplest of ways to remove unwanted frequencies in a given signal.


Those of us aware of what Digital Signal Processing (DSP) is and does, will undoubtedly have studied about FFT, its uses and applications. Before the uprise of FFT, the Discrete Fourier Transform (DFT) which does the same job as that of FFT existed, and it has not lost its charm even today.

Wondering why we humans were in dire need of FFT even though DFT existed to do the same job? I've mentioned a few important characteristics of FFT below for you to understand, keep reading!

Imagine you have a voice signal consisting of 512 samples, in order to know its frequency response one would need to compute DFT. If you know the formula for calculating DFT, you'd understand that the time it takes to do that computation is of order (512 x 512). Hold on! What if you have a signal with 10^6 samples? How long will you take to compute the frequency components? Doing simple math will tell you that it would be no less than 10^12. This could just take hours and hours which would simply consume a lot of power and more importantly, your precious time. This is where FFT comes in to save the day!

Fast Fourier Transform (FFT):

  • A fast Fourier transform (FFT) is an algorithm that calculates the discrete Fourier transform (DFT) of some sequence and transforms the structure of the cycle of a waveform into sine components.
  • A fast Fourier transform can be used in various types of signal processing. It may be useful in reading things like sound waves, or for any image-processing technologies.
  • A fast Fourier transform can be used to solve various types of equations, or show various types of frequency activity in useful ways.
  • For example, fast Fourier transform might be helpful in sound engineering, seismology or in voltage measurements.

For a sample set of 1024 values, the FFT is 102.4 times faster than the discrete Fourier transform (DFT). The basis for this remarkable speed advantage is the bit-reversal scheme of the CooleyTukey algorithm.

Note: These are just a few important aspects of FFT, there is a lot more out there than this.

Steps followed in the project:

Four sinusoidal signals with different frequencies were used to do this project as shown in figure (though the frequencies aren't clear). You'll find the hidden frequencies shortly.

A noisy signal was generated using MATLAB rand command which was added to all the signals. The four signals along with noise were added to generate a single signal with different frequency components, have a look (not clear either!)

The FFT of this signal was computed using the fft() function and the frequency spectrum was plotted to visualize the frequency components. Now you clearly see the frequency components along with the noise.

Next, a BPF was generated using the Filter Designer Toolbox and desired parameters were set which looked something like this, see the Magnitude Spectrum? Interesting, isn't it? You can change the parameters as you like to get the desired outcome. I wanted to remove the noise and retain the frequencies which I initially created my signal with. Thus the parameters.

Thus designed filter was exported to the workspace as an object, this filter was applied to the actual signal and corresponding FFT was computed to check for the frequency components retained.

I did this with both LPF and BPF just to get the hang of it, you can do as many modifications and as much processing as you like and have fun with the toolbox. The possibilities are wide.

Here's an image comparing all the signals generated in the process.

Thank you for reading! Hoping it helped :)

application_of_fft_with_fir_filter's People

Contributors

saadia-hassan avatar mahima8178 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.