# Testing a chebyshev filter

Started by February 9, 2005
I'm not quite sure what I'm expecting as an output!
I seem to be getting a square wave from a sine wave with an continually
decreasing frequency!
Is this right?
Cheers
Triff

Triff wrote:

> I'm not quite sure what I'm expecting as an output! > I seem to be getting a square wave from a sine wave with an continually > decreasing frequency! > Is this right? > Cheers > Triff > >
More information please! I assume you've just coded up a shiny new Chebyschev filter, fed it a sine wave, and you're getting a square wave out? * What's the platform? * Matlab? * A DSP chip? * Simulink with a toolbox? * What's the amplitude of the input? * What's the amplitude of the output? * What's the frequency of the input? * What's the intended cutoff frequency(s) of the filter? * Is it high-pass, low-pass, band-pass, band-stop? * Is it IIR? FIR? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Sorry, DSP is all very new to me, and so my understanding is basic.
Programming in java.
Creating sine waves in a byte array with a frequency range from about 20hz
to 20khz (ish). It's IIR and low-pass
Basically I've got 3 variables in the filter, frequency cut-off, percentage
ripple and number of poles.
I know that the Chebyshev procedure outputs the correct numbers which I put
them into the recursive filter procedure.
I can draw the input and the output but the output looks very wrong.
Whatever the variables I enter I just get different repetitions of square
waves.

"Tim Wescott" <tim@wescottnospamdesign.com> wrote in message
news:110ld8hnsj2dp7e@corp.supernews.com...
> Triff wrote: > >> I'm not quite sure what I'm expecting as an output! >> I seem to be getting a square wave from a sine wave with an continually >> decreasing frequency! >> Is this right? >> Cheers >> Triff > More information please! > > I assume you've just coded up a shiny new Chebyschev filter, fed it a sine > wave, and you're getting a square wave out? > > * What's the platform? > * Matlab? > * A DSP chip? > * Simulink with a toolbox? > * What's the amplitude of the input? > * What's the amplitude of the output? > * What's the frequency of the input? > * What's the intended cutoff frequency(s) of the filter? > * Is it high-pass, low-pass, band-pass, band-stop? > * Is it IIR? FIR? > > -- > > Tim Wescott > Wescott Design Services > http://www.wescottdesign.com
Sounds like you have a bug.  If you put in a sine wave, you should get out a
sine wave.  To simply, try putting in an impulse--a single sample of one (or
whatever your typical maximum input value is) followed by all zeros and then see
what you get out.  Your output should jump up and then decay toward zero,
probably oscillating around zero a few times, depending on the filter
parameters.  You can also try putting in "DC" (a string of identical input
values) and make sure you get the same DC value out (assuming your filter has
unity gain at DC).

news:36vsflF56ukunU1@individual.net...
> Sorry, DSP is all very new to me, and so my understanding is basic. > Programming in java. > Creating sine waves in a byte array with a frequency range from about 20hz > to 20khz (ish). It's IIR and low-pass > Basically I've got 3 variables in the filter, frequency cut-off, percentage > ripple and number of poles. > I know that the Chebyshev procedure outputs the correct numbers which I put > them into the recursive filter procedure. > I can draw the input and the output but the output looks very wrong. > Whatever the variables I enter I just get different repetitions of square > waves. > > "Tim Wescott" <tim@wescottnospamdesign.com> wrote in message > news:110ld8hnsj2dp7e@corp.supernews.com... > > Triff wrote: > > > >> I'm not quite sure what I'm expecting as an output! > >> I seem to be getting a square wave from a sine wave with an continually > >> decreasing frequency! > >> Is this right? > >> Cheers > >> Triff > > More information please! > > > > I assume you've just coded up a shiny new Chebyschev filter, fed it a sine > > wave, and you're getting a square wave out? > > > > * What's the platform? > > * Matlab? > > * A DSP chip? > > * Simulink with a toolbox? > > * What's the amplitude of the input? > > * What's the amplitude of the output? > > * What's the frequency of the input? > > * What's the intended cutoff frequency(s) of the filter? > > * Is it high-pass, low-pass, band-pass, band-stop? > > * Is it IIR? FIR? > > > > -- > > > > Tim Wescott > > Wescott Design Services > > http://www.wescottdesign.com > >
Cool cheers, think I'm getting there now, this might sound like a really dum
question but what use to chebushev filters have!?

"Jon Harris" <goldentully@hotmail.com> wrote in message
news:36vsqdF58oioiU1@individual.net...
> Sounds like you have a bug. If you put in a sine wave, you should get out > a > sine wave. To simply, try putting in an impulse--a single sample of one > (or > whatever your typical maximum input value is) followed by all zeros and > then see > what you get out. Your output should jump up and then decay toward zero, > probably oscillating around zero a few times, depending on the filter > parameters. You can also try putting in "DC" (a string of identical input > values) and make sure you get the same DC value out (assuming your filter > has > unity gain at DC). > > "Triff" <neverread@yahoo.com> wrote in message > news:36vsflF56ukunU1@individual.net... >> Sorry, DSP is all very new to me, and so my understanding is basic. >> Programming in java. >> Creating sine waves in a byte array with a frequency range from about >> 20hz >> to 20khz (ish). It's IIR and low-pass >> Basically I've got 3 variables in the filter, frequency cut-off, >> percentage >> ripple and number of poles. >> I know that the Chebyshev procedure outputs the correct numbers which I >> put >> them into the recursive filter procedure. >> I can draw the input and the output but the output looks very wrong. >> Whatever the variables I enter I just get different repetitions of square >> waves. >> >> "Tim Wescott" <tim@wescottnospamdesign.com> wrote in message >> news:110ld8hnsj2dp7e@corp.supernews.com... >> > Triff wrote: >> > >> >> I'm not quite sure what I'm expecting as an output! >> >> I seem to be getting a square wave from a sine wave with an >> >> continually >> >> decreasing frequency! >> >> Is this right? >> >> Cheers >> >> Triff >> > More information please! >> > >> > I assume you've just coded up a shiny new Chebyschev filter, fed it a >> > sine >> > wave, and you're getting a square wave out? >> > >> > * What's the platform? >> > * Matlab? >> > * A DSP chip? >> > * Simulink with a toolbox? >> > * What's the amplitude of the input? >> > * What's the amplitude of the output? >> > * What's the frequency of the input? >> > * What's the intended cutoff frequency(s) of the filter? >> > * Is it high-pass, low-pass, band-pass, band-stop? >> > * Is it IIR? FIR? >> > >> > -- >> > >> > Tim Wescott >> > Wescott Design Services >> > http://www.wescottdesign.com >> >> > >
news:371juiF3trmsrU1@individual.net...
> Cool cheers, think I'm getting there now, this might sound like a really
dum
> question but what use to chebushev filters have!?
Chebychev filters are just one type of filter. Filters in general, as the name implies, are used to filter out unwanted frequencies. A low pass filter passes all frequencies lower than a certain cut-off (Fc). A band-pass filter passes all frequencies in a certain 'band' (F_low and F_high). You can extend this to what high-pass filters are. One can build these types of filters using various architectures and various 'equations' that govern their shape in the frequency domain. Some of these equations have names (Chebychev, Butterworth, etc) since some dudes were the first to raise their hand and say "I've got a new one fellas". Filters are used in all kinds of applications including sound/audio processing, video processing, image processing, digital communications, etc Hope that helps... Cheers Bhaskar
> > "Jon Harris" <goldentully@hotmail.com> wrote in message > news:36vsqdF58oioiU1@individual.net... > > Sounds like you have a bug. If you put in a sine wave, you should get
out
> > a > > sine wave. To simply, try putting in an impulse--a single sample of one > > (or > > whatever your typical maximum input value is) followed by all zeros and > > then see > > what you get out. Your output should jump up and then decay toward
zero,
> > probably oscillating around zero a few times, depending on the filter > > parameters. You can also try putting in "DC" (a string of identical
input
> > values) and make sure you get the same DC value out (assuming your
filter
> > has > > unity gain at DC). > > > > "Triff" <neverread@yahoo.com> wrote in message > > news:36vsflF56ukunU1@individual.net... > >> Sorry, DSP is all very new to me, and so my understanding is basic. > >> Programming in java. > >> Creating sine waves in a byte array with a frequency range from about
> >> 20hz > >> to 20khz (ish). It's IIR and low-pass > >> Basically I've got 3 variables in the filter, frequency cut-off, > >> percentage > >> ripple and number of poles. > >> I know that the Chebyshev procedure outputs the correct numbers which I > >> put > >> them into the recursive filter procedure. > >> I can draw the input and the output but the output looks very wrong. > >> Whatever the variables I enter I just get different repetitions of
square
> >> waves. > >> > >> "Tim Wescott" <tim@wescottnospamdesign.com> wrote in message > >> news:110ld8hnsj2dp7e@corp.supernews.com... > >> > Triff wrote: > >> > > >> >> I'm not quite sure what I'm expecting as an output! > >> >> I seem to be getting a square wave from a sine wave with an > >> >> continually > >> >> decreasing frequency! > >> >> Is this right? > >> >> Cheers > >> >> Triff > >> > More information please! > >> > > >> > I assume you've just coded up a shiny new Chebyschev filter, fed it a > >> > sine > >> > wave, and you're getting a square wave out? > >> > > >> > * What's the platform? > >> > * Matlab? > >> > * A DSP chip? > >> > * Simulink with a toolbox? > >> > * What's the amplitude of the input? > >> > * What's the amplitude of the output? > >> > * What's the frequency of the input? > >> > * What's the intended cutoff frequency(s) of the filter? > >> > * Is it high-pass, low-pass, band-pass, band-stop? > >> > * Is it IIR? FIR? > >> > > >> > -- > >> > > >> > Tim Wescott > >> > Wescott Design Services > >> > http://www.wescottdesign.com > >> > >> > > > > > >