DSPRelated.com
Forums

lowpass tap count

Started by valtih1978 October 24, 2011
As opposed to differentiator, which operates locally (computes 
difference between two adjacent samples), integrator averages a huge 
number of samples over its huge time constant. This does not look 
practical. How do you do it?

thanks
On 10/24/2011 8:43 AM, valtih1978 wrote:
> As opposed to differentiator, which operates locally (computes > difference between two adjacent samples), integrator averages a huge > number of samples over its huge time constant. This does not look > practical. How do you do it?
First, dispel the misconception that a differentiator necessarily operates by taking the difference between adjacent samples. There are better ways for many purposes. Numerically integration produces of necessity a digital analog of definite integration, i.e., a summation over an interval. Overflow can't be guaranteed against without limiting the extent of the interval. (Tautology: in practical situations, there are ways to deal with this difficulty. That's what makes those situations practical.) That said, here's how to integrate: "integral"=0 For n=[0], to n=[enough] "integral"="integral"+x[n] I write "integral" because, as you can see, it is really a sum. Just as with differentiation, there are refinements, Simpson's Rule being one of them. As with analog circuits, a leaky integrator is often used. That can be implemented by y[n] = ax[n] - b[y[n-1] where a + b = 1 and both have the same sign. The convention is that x[n] and y[n] are the input and output respectively at t = n. Jerry -- Engineering is the art of making what you want from things you can get.
Thank you. This is clear. Yet, I wanted to know about convolution. When 
you need specific response characteristic.

In audio, you may want to have a pole at low frequency, say at 10 Hz (or 
event at zero. why not?). It corresponds to time const of 20pi. The 
transition processes last for 3..5 time constants, which is ≈4/60 sec. 
At the same time, sampling freq is 48kHz. It is 4/60/48k = 2400 samples 
per impulse response. It seems too much for me. Especially because 
high-frequency processes get away with much shorter times/convolutions.

As a beginner, I look at
"How to Obtain Discrete-Time Impulse Response from H(s)"
http://www.google.ee/url?sa=t&rct=j&q=transfer%20function%20impulse%20response&source=web&cd=5&ved=0CEYQFjAE&url=http%3A%2F%2Fwww.engr.uky.edu%2F~ymzhang%2FAdaptiveSystems%2FInterval%2520HW.doc&ei=mIWlTsGzEc2Uswazm5n7Ag&usg=AFQjCNFCHWRk_HC4jpb0BTtqc2jeeXzz6g&cad=rja 


I see that a couple of samples per response is enough to emerge a rough 
result. A couple of discretes per time constant, regardless of the time 
constant duration is ok! I suppose that the impulse response, which 
changes slowly, can be considered a constant over many 48k samples, 
resulting in only few h(t) samples. However, convolution consists of 
both h(t) * f(t). The f(t) samples still arrive at 48 kHz.

I'm asking if there is a way to do the convolution without storing those 
2400 latest samples?

Thanks
On Oct 24, 11:04&nbsp;am, valtih1978 <d...@not.email.me> wrote:
> Thank you. This is clear. Yet, I wanted to know about convolution. When > you need specific response characteristic. > > In audio, you may want to have a pole at low frequency, say at 10 Hz (or > event at zero. why not?). It corresponds to time const of 20pi. The > transition processes last for 3..5 time constants, which is &asymp;4/60 sec. > At the same time, sampling freq is 48kHz. It is 4/60/48k = 2400 samples > per impulse response. It seems too much for me. Especially because > high-frequency processes get away with much shorter times/convolutions. > > As a beginner, I look at > "How to Obtain Discrete-Time Impulse Response from H(s)"http://www.google.ee/url?sa=t&rct=j&q=transfer%20function%20impulse%2... > > I see that a couple of samples per response is enough to emerge a rough > result. A couple of discretes per time constant, regardless of the time > constant duration is ok! I suppose that the impulse response, which > changes slowly, can be considered a constant over many 48k samples, > resulting in only few h(t) samples. However, convolution consists of > both h(t) * f(t). The f(t) samples still arrive at 48 kHz. > > I'm asking if there is a way to do the convolution without storing those > 2400 latest samples? > > Thanks
Tell us what you are trying to achieve. Jerry showed you how to do it with 2 y-samples, and 1 x-sample. Then you talk about 2400 samples. Again, what are you trying to do????
I try to do a filter in practice. I know the influence of zeros and 
poles on the transfer function. I convert it into impulse response and 
convolve with it. Faced the need for large tap counts at low 
frequencies, I decided to ask if it is ok.


BTW, if you know how to do equalization (combining different amounts of 
frequency bands) I would appreciate.
On 10/24/2011 12:04 PM, valtih1978 wrote:
> Thank you. This is clear. Yet, I wanted to know about convolution. When > you need specific response characteristic.
As you can see, convolution isn't usually a good way to integrate.
> In audio, you may want to have a pole at low frequency, say at 10 Hz (or > event at zero. why not?). It corresponds to time const of 20pi. The > transition processes last for 3..5 time constants, which is &asymp;4/60 sec. > At the same time, sampling freq is 48kHz. It is 4/60/48k = 2400 samples > per impulse response. It seems too much for me. Especially because > high-frequency processes get away with much shorter times/convolutions.
Consider an analog RC high-pass with a 3 dB point at 10 Hz or about 63 radians/sec. The time constant is about .016 seconds. Let's call the impulse response (i.e., the time for the response to an impulse to decay to insignificance) 5 time constants. Here, that's .8 seconds. .8 seconds * 48,000 samples/second comes to 38,400 samples. How did you get 2400? An infinite impulse response structure (IIR) is a relatively inexpensive way (measured in resources) to get a long impulse response. (That shouldn't be a surprise.)
> As a beginner, I look at > "How to Obtain Discrete-Time Impulse Response from H(s)" > http://www.google.ee/url?sa=t&rct=j&q=transfer%20function%20impulse%20response&source=web&cd=5&ved=0CEYQFjAE&url=http%3A%2F%2Fwww.engr.uky.edu%2F~ymzhang%2FAdaptiveSystems%2FInterval%2520HW.doc&ei=mIWlTsGzEc2Uswazm5n7Ag&usg=AFQjCNFCHWRk_HC4jpb0BTtqc2jeeXzz6g&cad=rja > > > I see that a couple of samples per response is enough to emerge a rough > result. A couple of discretes per time constant, regardless of the time > constant duration is ok! I suppose that the impulse response, which > changes slowly, can be considered a constant over many 48k samples, > resulting in only few h(t) samples. However, convolution consists of > both h(t) * f(t). The f(t) samples still arrive at 48 kHz. > > I'm asking if there is a way to do the convolution without storing those > 2400 latest samples?
The delay of a symmetric FIR filter of length N is (N-1)/2. Its impulse response is simply N. There is no way to specify an impulse response with fewer taps than that. I looked at the material you linked to. I don't find in it a way to generate an arbitrary time constant with only a couple of samples. Jerry -- Engineering is the art of making what you want from things you can get.
 > comes to 38,400 samples. How did you get 2400?

.016*5 = 0.08 rather than 0.8! That is why 10-fold difference. :)


 > I don't find in it a way to generate an arbitrary time constant with 
only a couple of samples.

"3.  How to select T, where T is the sampling period:  approximately 1/5 
to &frac12;  of the dominant time constant. "

This is only 2..5 samples per T.


 > There is no way to specify an impulse response with fewer taps than 
that.

This is the key. Thanks.
On 10/24/2011 2:01 PM, valtih1978 wrote:
> > comes to 38,400 samples. How did you get 2400? > > .016*5 = 0.08 rather than 0.8! That is why 10-fold difference. :)
I need to start using a calculator.! (2400 < 3840)
> > I don't find in it a way to generate an arbitrary time constant with > only a couple of samples. > > "3. How to select T, where T is the sampling period: approximately 1/5 > to &frac12; of the dominant time constant. "
Ah, but you aren't free to select the sampling frequency. You fixed it at 40 KHz.
> This is only 2..5 samples per T.
Yes, plenty for 10 Hz., but you need to handle 20 KHz also if this is audio. That is why filters for frequencies very much less than the sampling frequency are usually IIR. With higher orders, their responses can be quite detailed.
> > There is no way to specify an impulse response with fewer taps than > that. > > This is the key. Thanks.
You're welcome. Jerry -- Engineering is the art of making what you want from things you can get.
 > There is no way to specify an impulse response with fewer taps than 
that.

I have discovered http://www.dspguide.com/CH14.PDF, which says that we 
can always get highpass from lowpass just by flipping convolution 
coefficient signs. (The amount of coefficients in not changed)

The idea is: "run the signal through a low-pass filter, and then 
subtract the filtered signal from the original!"
On Oct 25, 1:43&#4294967295;am, valtih1978 <d...@not.email.me> wrote:
> As opposed to differentiator, which operates locally (computes > difference between two adjacent samples), integrator averages a huge > number of samples over its huge time constant. This does not look > practical. How do you do it? > > thanks
A summation can be written recursively. There is a simple proof for this which I can't be bothered writing but you find the sum with k terms and then find the sum for k+1. Then write the latter in terms of the former.