GithubHelp home page GithubHelp logo

Bandpass frequencies about nwaves HOT 4 CLOSED

CodeWithMichal avatar CodeWithMichal commented on August 17, 2024
Bandpass frequencies

from nwaves.

Comments (4)

ar1st0crat avatar ar1st0crat commented on August 17, 2024

Hi!
You need to pass normalized frequencies. See here

from nwaves.

CodeWithMichal avatar CodeWithMichal commented on August 17, 2024

Hi, thank you for reply!

So having Sampling Rate 250Hz should I rather do following?

myFilter = new BandPassFilter(22/250, 32/250, 6);

or rather

myFilter = new BandPassFilter(22/125, 32/125, 6);

If I use 250 instead of 125 my filter is unstable

Edit:

If I reduce sampling rate to 125Hz and use
myFilter = new BandPassFilter(22/125, 32/125, 6);
then its fine but working with sampling rate 250Hz and
myFilter = new BandPassFilter(22/250, 32/250, 6);
makes filter usntable. What could be the root cause?

from nwaves.

ar1st0crat avatar ar1st0crat commented on August 17, 2024

I guess the similar issue is described here.
I checked the coefficients for your filter specs - they are the same (or at least very close to sciPy/MATLAB).

According to suggestion in the link I've provided, you can try applying SOS. Something like this:

var f1 = 22000 / 250000f;
var f2 = 32000 / 250000f;
var filter = new Filters.Butterworth.BandPassFilter(f1, f2, 6);

// break filter into second-order-sections:
var sos = DesignFilter.TfToSos(filter.Tf);
var sosFilter = new FilterChain(sos);

// apply SOS
var filteredSignal = sosFilter.ApplyTo(signal);

// or process online:
// foreach (var sample in signal)
//     var output = sosFilter.Process(sample);

from nwaves.

CodeWithMichal avatar CodeWithMichal commented on August 17, 2024

Thank you, applying SOS helped :)

from nwaves.

Related Issues (20)

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.