Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Understanding Implementation of High Pass Filter
Hi,
I wrote the other day asking about Noise Gates and got some really good replies which greatly helped in my understanding of how they work. Thanks Guys!!! Today, I'm asking about a High Pass Filter. Again, I just started working on a project where the computer captures samples of someone's speech. Each of these samples is run through a 50 Hz High Pass Filter to improve the quality of the sample. I've done a lot of reading about High Pass filters and think I understand pretty well how they work. What I don't understand though is a couple of the variables in the program where the filter is actually implemented. I'm hoping someone out there knows java and can help tell me what they mean. Code follows and then my questions... public class HighPass50 { static int NZEROS = 5; static int NPOLES = 5; static double GAIN = 1.095980088e+00; double xv[] = new double[NZEROS+1]; double yv[] = new double[NPOLES+1]; public HighPass50() {} public void process(short data[]) { for (int i=0; i data.length; ++i) { xv[0] = xv[1]; xv[1] = xv[2]; xv[2] = data[i] / GAIN; yv[0] = yv[1]; yv[1] = yv[2]; yv[2] = (xv[0] + xv[2]) - 2 * xv[1] + ( -0.9479259375 * yv[0]) + ( 1.9469976496 * yv[1]); data[i] = (short)yv[2]; } } } Looking at the method above, I don't understand the meaning of the 'GAIN' variable (and more specifically the number it is set to). Is this likely the cutoff frequency? Also, in the next to the last line of the method, where yv[2] = ..., there are two numbers in this line that I have no idea what they mean. The number "-0.9479259375" and the number "1.9469976496". My guess is that the number "-0.9479259375" is the lowest frequency possible (zero Hz) and that "1.9469976496" is the highest frequency possible. This would make sense if the GAIN variable was the cutoff frequency. Again, that is my best guess! Can someone help with my understanding??? Thanks in advance, Scott |
#2
|
|||
|
|||
Understanding Implementation of High Pass Filter
Scott Soderlund wrote:
Snip Looking at the method above, I don't understand the meaning of the 'GAIN' variable (and more specifically the number it is set to). Is this likely the cutoff frequency? Also, in the next to the last line of the method, where yv[2] = ..., there are two numbers in this line that I have no idea what they mean. The number "-0.9479259375" and the number "1.9469976496". My guess is that the number "-0.9479259375" is the lowest frequency possible (zero Hz) and that "1.9469976496" is the highest frequency possible. This would make sense if the GAIN variable was the cutoff frequency. Again, that is my best guess! Can someone help with my understanding??? No, the filter has some gain in the passband, which has been calculated during the design, by dividing the input by this the code ensures that the output level at high frequency is the same as the input. The other numbers are the coefficents derived from the recurrence relation which are derived from the Z plane poles & zeros. The Z plane pole zero diagram is derived by warping the S plane pole & zero positions to account for the discrete time nature of the filter. Digital filters are a HUGE sunject and there is lots of literature out there. There is an interactive design program for some of the possibilities at: http://www-users.cs.york.ac.uk/~fisher/mkfilter which is a very easy way to design 1 off simple filters. In fact I would not be surprised if this is the original source of your code. Regards, Dan. -- ** The email address *IS* valid, do NOT remove the spamblock And on the evening of the first day the lord said........... ..... LX 1, GO!; and there was light. |
#3
|
|||
|
|||
Understanding Implementation of High Pass Filter
|
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
High Pass Filtering - How Audible? | Audio Opinions | |||
rec.audio.car FAQ (Part 4/5) | Car Audio | |||
Bose high pass filter | Audio Opinions | |||
Crossover Point - Low & High Pass Filter Slope | High End Audio | |||
Low pass filter question... | Car Audio |