Coder Social home page Coder Social logo

et-link / butterworth_filter_coefficients-matlab-in-c Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wustyuyi/butterworth_filter_coefficients-matlab-in-c

1.0 0.0 0.0 22 KB

In order to obtain the same results as the function 'butter' in MATLAB, uses 'high' and filter order 4 for example

C++ 37.50% C 62.50%

butterworth_filter_coefficients-matlab-in-c's Introduction

Butterworth_filter_coefficients-MATLAB-in-C

Motivation

In order to obtain the same results as the function 'butter' in MATLAB, uses 'high' and filter order 4 for example

[BB, AA] = butter(4,freq,'high')

How to use

Just include the header file and write your own codes based on the example programs.

  • bwlp.c-lowpass filter coefficient calculator
  • bwhp.c-highpass ilter coefficient calculator
  • bwbp.c-bandpass filter coefficient calculator
  • bwbs.c-bandstop filter coefficient calculator

These are the official guides but i recommend you to check out my example code butter.cpp!

Useful tip

Actually if you have finished the program you might find the result different from that in MATLAB.
Just as the question in STACKOVERFLOW.
This bro indeed has brilliant ability to solve this problem, but i strongly recommend you an easier way.
  The problem is that the result you got from the code hasn't been normalized, and notice that a variable sff either in my example code or in bwhp.c.
If you set that to 1, the problem will be solved.

int sff;  //scale flag: 1 to scale, 0 to scale ccof

btw. Would someone please help me answer the question on stackoverflow?I don't have any reputation lol.

butterworth_filter_coefficients-matlab-in-c's People

Contributors

charles-typ avatar

Stargazers

 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.