From: Ross on
"Correcting" is not going to be the right word, but here's my problem.

I would like to have a brick wall filter with no phase delay and
moderate computational complexity. (Yes, I know, who wouldn't).

I'm actually using Butterworth lowpass filters of order 4 as designed
by Tony Fisher's web page.

Imagine I create a 4 pole LPF, with a corner frequency of 31Hz with a
sampling rate of 44.1Khz. The filter gain is very high. On the order
of 4.77e10 or something like that.

I've created a sample signal to feed into this. It has 30 samples of
silence, followed by a 20 Hz (non-bandlimited) sawtooth wave for 44100
samples.

If I filter this signal and then graph the result, it takes some time
for the filter to "get going". The first cycle has a
"concave" (looking from left to right) start from zero and climb to
first peak, rather than the slightly convex more sine-like rises later
on. Also, the height of the first peak is lower than other ones.

Are there any techniques or research on how to "correct" early output
from a filter after there has been a sudden change from (relative)
silence to signal? I will not be using the output of the filter in any
audio that is actually listenened to. I will only be tracking the zero
crossings and peaks of the waveform. However, I need to have an
estimate early on of the peak value of the waveform passing through.
Tricky given that the filter takes some time to "get going" (AKA the
filter isn't a brick wall filter).

Any hints?
From: Rune Allnor on
On 26 apr, 12:20, Ross <rossclem...(a)gmail.com> wrote:
> "Correcting" is not going to be the right word, but here's my problem.
>
> I would like to have a brick wall filter with no phase delay and
> moderate computational complexity. (Yes, I know, who wouldn't).

....so you don't know much 'bout filters, do you?

> Are there any techniques or research on how to "correct" early output
> from a filter after there has been a sudden change from (relative)
> silence to signal?

The initial transient is a fact of life.

Rune
From: Ross on
On Apr 26, 12:30 pm, Rune Allnor <all...(a)tele.ntnu.no> wrote:
> On 26 apr, 12:20, Ross <rossclem...(a)gmail.com> wrote:
>
> > "Correcting" is not going to be the right word, but here's my problem.
>
> > I would like to have a brick wall filter with no phase delay and
> > moderate computational complexity. (Yes, I know, who wouldn't).
>
> ...so you don't know much 'bout filters, do you?

Can you please explain what you mean by this? I know that there are no
brick wall filters and I believe my message made it clear that I
wasn't expecting to be able to completely repair the signal from my
significantly not "brick wall" filter to make it a higher performing
*all purpose* filter. My comment about wanting a brick wall filter
without significant delay nor excessive computational requirements was
a tongue in check comment intended to be read as "ideally what I'd
like is this, but since I know I won't get it, ....."

> > Are there any techniques or research on how to "correct" early output
> > from a filter after there has been a sudden change from (relative)
> > silence to signal?
>
> The initial transient is a fact of life.

Please note that I'm not expecting to produce, by compensating for it,
a brick wall filter. I'm looking at a situation where I intend to
track the frequency and magnitude of the output from the filter based
on the assumption that it's a reasonable approximation to a sine wave.

If the output was an idea sine wave, which it won't be given that the
filter is not ideal nor will the input signal be idea, then with a few
samples I could fit a sinewave to the input with three samples or so.
Since my input is not ideal, I'll only be able to constrain the
frequency within a probability distribution. After a few cycles of
input, I'll be able to constrain the frequency between upper and lower
bounds which will be amply accurate for my needs. But, when the input
signal goes from 0 to signal, partially due to the initial transient
of the filter, I expect that simple methods will give me too wide a
probability distribution for frequencies. I can apply a number of "AI"
style techniques on the unmodified output of the filter which may
(experiments not yet done) improve the accuracy of the prediction
early on. However, it would be silly to reinvent wheels should there
be research that characterises the nature of the initial transients
from filters such that their effect on dynamic signals is well
understood and can be predicted for non-trivial input signals.

Is this clearer?
From: Greg Berchin on
On Mon, 26 Apr 2010 03:20:54 -0700 (PDT), Ross <rossclement(a)gmail.com> wrote:

>Are there any techniques or research on how to "correct" early output
>from a filter after there has been a sudden change from (relative)
>silence to signal?

Ah, the perils of designing in the frequency domain. It's so much easier to get
that frequency response "just right" when you don't have to worry about the time
domain.

Consider that frequency response is a steady-state concept. That is to say,
when you specify the response of a filter at a certain frequency, you tacitly
assume that a signal of constant amplitude at that frequency was applied an
infinitely long time ago, and will continue for an infinite time to come.

But we live in the time domain. Signals start, stop, and change. Those starts,
stops, and changes trigger time-domain responses from filters. And the
time-domain responses can be very unattractive when the filters are designed in
the frequency domain. It is a fundamental give-and-take; to optimize something
in the frequency domain almost always means to "un-optimize" something else in
the time domain, and vice-versa.

So the answer to your question on how to "correct" the filter is to design the
filter for better time domain response in the first place. And, of course, that
means giving up something in the frequency domain.

Greg
From: Jerry Avins on
On 4/26/2010 9:36 AM, Ross wrote:
> On Apr 26, 12:30 pm, Rune Allnor<all...(a)tele.ntnu.no> wrote:
>> On 26 apr, 12:20, Ross<rossclem...(a)gmail.com> wrote:
>>
>>> "Correcting" is not going to be the right word, but here's my problem.
>>
>>> I would like to have a brick wall filter with no phase delay and
>>> moderate computational complexity. (Yes, I know, who wouldn't).
>>
>> ...so you don't know much 'bout filters, do you?
>
> Can you please explain what you mean by this? I know that there are no
> brick wall filters and I believe my message made it clear that I
> wasn't expecting to be able to completely repair the signal from my
> significantly not "brick wall" filter to make it a higher performing
> *all purpose* filter. My comment about wanting a brick wall filter
> without significant delay nor excessive computational requirements was
> a tongue in check comment intended to be read as "ideally what I'd
> like is this, but since I know I won't get it, ....."
>
>>> Are there any techniques or research on how to "correct" early output
>>> from a filter after there has been a sudden change from (relative)
>>> silence to signal?
>>
>> The initial transient is a fact of life.
>
> Please note that I'm not expecting to produce, by compensating for it,
> a brick wall filter. I'm looking at a situation where I intend to
> track the frequency and magnitude of the output from the filter based
> on the assumption that it's a reasonable approximation to a sine wave.
>
> If the output was an idea sine wave, which it won't be given that the
> filter is not ideal nor will the input signal be idea, then with a few
> samples I could fit a sinewave to the input with three samples or so.
> Since my input is not ideal, I'll only be able to constrain the
> frequency within a probability distribution. After a few cycles of
> input, I'll be able to constrain the frequency between upper and lower
> bounds which will be amply accurate for my needs. But, when the input
> signal goes from 0 to signal, partially due to the initial transient
> of the filter, I expect that simple methods will give me too wide a
> probability distribution for frequencies. I can apply a number of "AI"
> style techniques on the unmodified output of the filter which may
> (experiments not yet done) improve the accuracy of the prediction
> early on. However, it would be silly to reinvent wheels should there
> be research that characterises the nature of the initial transients
> from filters such that their effect on dynamic signals is well
> understood and can be predicted for non-trivial input signals.
>
> Is this clearer?

What is clear is that you don't understand the problem. I'll try to
explain. Whether digital or analog, every filter has memory elements. (I
assume that you can identify them in your particular filter. If not,
ask.) Until the contents of those memory elements settle to a repeating
cycle of values determined by a repetitive input, the output of the
filter will deviate from the naively expected. If you know enough about
the input signal to preload the memory elements (set the initial
conditions, as the math people say) you don't really need a filter. The
output of an IIR filter depends on a large number of the input samples.
The "expected" output assumes an infinite number of them.

You have another problem. Your signal isn't bandlimited, so many of its
higher components alias into the passband. That changes what you expect
(or should expect) your output to be.

Jerry
--
"I view the progress of science as ... the slow erosion of the tendency
to dichotomize." --Barbara Smuts, U. Mich.
�����������������������������������������������������������������������