From: steveu on
>Hi,
>
>Thanks a lot for your feedback. Specification details include:
>
>1. High-pass filter with cut-off at 0.5 Hz. Cut-off precision is not
>critical: a cut-off between 0.2 -> 0.8 Hz is fine.
>
>2. This is a non-realtime calculation, so large computation time is no
>problem.
>
>3. A typical signal is a 25 second sample comprising 10000 points sampled
>at 400 Hz.
>
>Any help much appreciated!
>
>John

That sounds like your goal is merely to eliminate a DC component. If that
is the case, and you are always working with discrete chunks of some
seconds of data, you'd probably be better off with a 2 pass approach. In
pass 1 you find the average of all the samples. In pass 2 you subtract this
from every sample.

Steve

From: Rick Lyons on
On Mon, 12 Apr 2010 05:20:50 -0500, "steveu"
<steveu(a)n_o_s_p_a_m.coppice.org> wrote:

>>Hi,
>>
>>Thanks a lot for your feedback. Specification details include:
>>
>>1. High-pass filter with cut-off at 0.5 Hz. Cut-off precision is not
>>critical: a cut-off between 0.2 -> 0.8 Hz is fine.
>>
>>2. This is a non-realtime calculation, so large computation time is no
>>problem.
>>
>>3. A typical signal is a 25 second sample comprising 10000 points sampled
>>at 400 Hz.
>>
>>Any help much appreciated!
>>
>>John
>
>That sounds like your goal is merely to eliminate a DC component. If that
>is the case, and you are always working with discrete chunks of some
>seconds of data, you'd probably be better off with a 2 pass approach. In
>pass 1 you find the average of all the samples. In pass 2 you subtract this
>from every sample.
>
>Steve

Hello Steve,
If you are correct about the goal being
"DC removal", maybe the material at:

http://www.dsprelated.com/showarticle/58.phpFatScouser

would be useful to FatScouser.

See Ya',
[-Rick-]

From: FatScouser on
Hi,

Am afraid I can't give you figures for acceptable passband ripple and
attenuation. All I can say is that I'm using this DSP package to set a
highpass filter at 0.2 Hz, and the output shows a significant ripple at the
same frequency when there is no signal in the input.

Should I apply a Blackman window function as well?

I'm not trying to remove a DC component; I am trying to show the
time-domain signal with frequencies < 0.5 Hz removed.

Sorry I can't be more specific. In terms of relative amplitudes, however,
the resultant ringing artifacts are about 30% of the desired high-frequency
signal.

Thanks,
John

>On Mon, 12 Apr 2010 05:20:50 -0500, "steveu"
><steveu(a)n_o_s_p_a_m.coppice.org> wrote:
>
>>>Hi,
>>>
>>>Thanks a lot for your feedback. Specification details include:
>>>
>>>1. High-pass filter with cut-off at 0.5 Hz. Cut-off precision is not
>>>critical: a cut-off between 0.2 -> 0.8 Hz is fine.
>>>
>>>2. This is a non-realtime calculation, so large computation time is no
>>>problem.
>>>
>>>3. A typical signal is a 25 second sample comprising 10000 points
sampled
>>>at 400 Hz.
>>>
>>>Any help much appreciated!
>>>
>>>John
>>
>>That sounds like your goal is merely to eliminate a DC component. If
that
>>is the case, and you are always working with discrete chunks of some
>>seconds of data, you'd probably be better off with a 2 pass approach. In
>>pass 1 you find the average of all the samples. In pass 2 you subtract
this
>>from every sample.
>>
>>Steve
>
>Hello Steve,
> If you are correct about the goal being
>"DC removal", maybe the material at:
>
>http://www.dsprelated.com/showarticle/58.phpFatScouser
>
>would be useful to FatScouser.
>
>See Ya',
>[-Rick-]
>
>
From: Rune Allnor on
On 12 apr, 14:17, "FatScouser" <john.hague(a)n_o_s_p_a_m.truebit.co.uk>
wrote:
> Hi,
>
> Am afraid I can't give you figures for acceptable passband ripple and
> attenuation. All I can say is that I'm using this DSP package to set a
> highpass filter at 0.2 Hz, and the output shows a significant ripple at the
> same frequency when there is no signal in the input.

That's related to the impulse response of the filter.
Depending on exactky what you are doing, it might be the
impulse response itself.

Either way, that ringing is related to the narrow bandwidths
mentioned.

> Should I apply a Blackman window function as well?

Not unless you understand why you would want to apply the window.

> I'm not trying to remove a DC component; I am trying to show the
> time-domain signal with frequencies < 0.5 Hz removed.

You shouldn't use the term 'removed'. You should show the signal
with the band *attenuated*. This is not a semantic quibble but
rather the key to obtaining a useful result. As I said previously,
the idea is to not specify a *perfect* solution (which would only
be approximated, causing all kinds of misery and mayhem), but rather
to specify an *acceptable* solution. In order to do that, you
need to specify a lower limit to the pass band.

Or alternatively, re-state the problem as a DC-blocking notch
filter. You might obtain an acceptable result by playing with
notch widths etc.

Rune
From: Tim Wescott on
FatScouser wrote:
(top posting fixed)
> On 12 apr, 10:02, "FatScouser" <john.hague(a)n_o_s_p_a_m.truebit.co.uk>
>> wrote:
>>> Hi,
>>>
>>> I'm using an off-the-shelf DSP package to apply an FFT-based highpass
>>> filter to a time-domain signal. This causes 'ringing' in the output,
> where
>>> a sine wave appears from nowhere having the same frequency as the high
> pass
>>> cut-off frequency. The DSP package does not provide much information
> about
>>> how the filter works, only that it is FFT-based.
>>>
>>> Working solely within the time domain, can anyone suggest what sort of
>>> filter or filter settings I should be using so I don't see the rinning
>>> artifacts?
>> Ringing is part of the filter response. There is nothing
>> you can do to prevent it from happening.
>>
>> What remains is to control it so that it stays within
>> acceptable limits. There are several factors that influence
>> ringing, like the width of stop-bands, notches and transition
>> bands.
>>
>> A lot of amateurs don't understand these things, and write
>> an FFT-based routine that zeros an arbitrary set of DFT
>> coefficients. This is a certain way to intropduce these kinds
>> of artifacts.
>>
>> To get a working filter,
>>
>> 1) Come up with a specification. Not for what you want (everybody
>> want all the benefits without all the drawbacks), but for what
>> you need (the benefit you can't do without and the drawbacks
>> you can live with).
>>
>> 2) Use a filter design package to find the filter that satisfies
>> the spec from 1).
>>
>> Rune
>>
> Hi,
>
> Thanks a lot for your feedback. Specification details include:
>
> 1. High-pass filter with cut-off at 0.5 Hz. Cut-off precision is not
> critical: a cut-off between 0.2 -> 0.8 Hz is fine.
>
> 2. This is a non-realtime calculation, so large computation time is no
> problem.
>
> 3. A typical signal is a 25 second sample comprising 10000 points sampled
> at 400 Hz.
>
> Any help much appreciated!

My knee-jerk reaction with this specification would be to try a filter
with a raised-sine cutoff that starts at 0.2Hz and runs 0.8Hz. You'll
get ringing, but it'll be much attenuated over a filter that just hits a
brick wall at 0.2Hz.

But without knowing the details of your DSP packages I'm not sure if you
can specify this.

And without knowing what you really need I'm not sure if this will be
satisfactory. You can always give it a whirl, and see.

What Rune was trying to point out is that _any_ filter that takes the
response all the way to zero at any frequency other than DC will suffer
from ringing to a greater or lesser extent -- you don't get to control
the existence of ringing, you just get some control over the extent.

If you're filtering distinct chunks of data then windowing the data will
hold down the spurious high-frequency content and therefore the amount
of ringing -- but the span over which the windowing function transitions
from no to full gain will need to be longer than 5 seconds to make much
difference to a filter that rings at 0.2Hz.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com