FIXED Problem with my own filter

hardware, software, tips and tricks
Forum rules
By using this "Production" sub-forum, you acknowledge that you have read, understood and agreed with our terms of use for this site. Click HERE to read them. If you do not agree to our terms of use, you must exit this site immediately. We do not accept any responsibility for the content, submissions, information or links contained herein. Users posting content here, do so completely at their own risk.

Quick Link to Feedback Forum
Locked
User avatar
mromgwtf
Posts: 882
Joined: Wed May 09, 2012 1:06 pm

FIXED Problem with my own filter

Post by mromgwtf » Sun Nov 10, 2013 10:35 am

This is an DSP question.

I'm getting into DSP lately, and as an exercise I decided to write my own LP filter (or more likely copy it from musicdsp).
It's an 6db/oct filter. It is somehow working but it adds weird bitcrushed noise on top of it. Here is how it works:
Soundcloud

You can hear the drum loop getting actually lowpassed but why the noise? For me it sounds like the previous buffer ends and the current buffer starts on different values, and therefore the clicky noise. But how to fix it?

Code: Select all

	double x,a0,b1;
	x = exp(-2.0*PI*500.0/GetSampleRate());
	a0 = 1.0 - x;
	b1 = -x;

	for(int i = 0; i < nFrames; i++, input++, output++)
	{
		*output = a0 * (*input) - b1*tmp;
		tmp = *output;
	}
@Edit:

Ok I fixed it a bit the problem was that you need to make the tmp variable global and leave it as it is for the next buffer.
Exilium wrote:distorted square

Locked

Who is online

Users browsing this forum: No registered users and 0 guests