View Single Post
  #3 (permalink)  
Old 03-06-2007, 05:53 PM
DSP-Newbie
Guest
 
Posts: n/a
Default Re: Time domain convolution in a real-time situation

[email protected] wrote:

> You could certainly change the code to calculate the entire
> sequence, starting at index 0, but you would need some additional
> logic to handle this case, as in these cases you will not have enough
> input samples to evaluate every term of the sum. You would probably
> instead assume that the input signal is causal and is therefore zero
> for indices less than zero.


Thanks for the input Jason,

By causal I am assuming I should take the input signal "as is"?

Here's how I do it now:

- I add zeroes (number = length of H[]) at the beginning and end of
X[].

- I have changed the original algorithm to:

if j-i < 0 then
Y[j] := Y[j] + Tx[i] * H[i]
else
Y[j] := Y[j] + Tx[j-i] * H[i];

Y[] now becomes something like:
http://users.pandora.be/dirk.claesse...bandfilter.JPG

My problem now was, which part of Y[] should I extract and use?
After much and trial & error and some hair-pulling, I finally found a
intuitive solution that actually works:

As starting index I use 1.5 times the length of H[],
For the extraction length I use the original length of X[].

I've tested it for a wide range of bandwidths, and it works.
I wonder if you or someone else can comment on whether this is:
- a plain hack ? :-)
- a mathematically correct method?

Thanks - Dirk








// 75=900 125=500
Y := Copy(y, Round(Length(H)*1.5) , Length(X));


Reply With Quote