# OpenViBE forum

The OpenViBE community
 It is currently Sat Aug 24, 2019 6:30 pm

 All times are UTC

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Temporal Filter Box - Bandpass orderPosted: Mon Jun 03, 2019 5:01 pm

Joined: Fri May 17, 2019 2:05 pm
Posts: 2
Location: Plymouth, UK
I am using the Temporal Filter Box for band-energy computation.
I was wondering if the order of the Bandpass filter is the parameter "Filter Order" or double that, as in MATLAB, so that both the band-pass and the hi-pass transition-bands of the filter have the steepness of a "Filter Order" order filter.

I've been reading this forum for a while, but it's my first post, so if I didn't explain myself or this is not the right place or way to post my question, please let me know.

Top

 Post subject: Re: Temporal Filter Box - Bandpass orderPosted: Tue Jun 04, 2019 8:23 am

Joined: Wed Oct 31, 2018 9:14 am
Posts: 93
hello, this is the right place (the forum is not very big ^ ^).
Regarding, the order, I just looked at the Butterworth code. Having never had to study this type of filtering, I put you directly the part of the code use the order passed in parameter (numpole is the order) when creating the filter that you can judge by yourself.
The file is here : [OpenViBE-FOLDER]\sdk\dependencies-source\dsp-filters

Code:
void AnalogLowPass::design(int numPoles)
{
if (m_numPoles != numPoles)
{
m_numPoles = numPoles;
reset();
const double n2 = 2 * numPoles;
const int pairs = numPoles / 2;
for (int i = 0; i < pairs; ++i)
{
complex_t c = std::polar(1., doublePi_2 + (2 * i + 1) * doublePi / n2);
}
if (numPoles & 1) { add(-1, infinity()); }
}
}

Top

 Post subject: Re: Temporal Filter Box - Bandpass orderPosted: Tue Jun 04, 2019 4:07 pm

Joined: Fri May 17, 2019 2:05 pm
Posts: 2
Location: Plymouth, UK
Unfortunately the code snippet you posted was about the LowPass filter, but it gave me directions for where to look in the code.

In [OpenViBE-FOLDER]\sdk\dependencies-source\dsp-filters\Butterworth.h (rows 145 to 184) it can be seen that the number of poles (and zeros, I guess) is double for the band filters
Code:
//
// Raw filters
//

template <int MaxOrder>
struct LowPass : PoleFilter <LowPassBase, MaxOrder>
{
};

template <int MaxOrder>
struct HighPass : PoleFilter <HighPassBase, MaxOrder>
{
};

template <int MaxOrder>
struct BandPass : PoleFilter <BandPassBase, MaxOrder, MaxOrder*2>
{
};

template <int MaxOrder>
struct BandStop : PoleFilter <BandStopBase, MaxOrder, MaxOrder*2>
{
};

template <int MaxOrder>
struct LowShelf : PoleFilter <LowShelfBase, MaxOrder>
{
};

template <int MaxOrder>
struct HighShelf : PoleFilter <HighShelfBase, MaxOrder>
{
};

template <int MaxOrder>
struct BandShelf : PoleFilter <BandShelfBase, MaxOrder, MaxOrder*2>
{
};

//------------------------------------------------------------------------------

I think this answers my question, unless someone with more experience than me in digging into the OpenVibe source code shows that I got it wrong

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ General    OpenViBE News    Discussion about OpenViBE    Discussion about BCI and related topics    Feature Requests Using OpenViBE components    Acquisition server and drivers    Designer    Boxes OpenViBE scenarios    Scenarios and BCI design    Tutorial scenarios OpenViBE-related development    Help for building the software    Box and application development    Driver development    Kernel development