filterfir vs convolve speed

Hi,

According to the 'filterfir' documentation,
FilterFIR filters data faster than Convolve when there are many fewer filter coefficient values than data points in waveName.
However, when I execute the following code:
filterfir/lo={0.3,0.31,201}/coef coefs
make/o/d/n=1e7 data
variable tim
tim = ticks; filterfir/coef=coefs data; tim = ticks-tim; print tim
tim = ticks; convolve coefs, data; tim = ticks-tim; print tim

the convolve operation is ~4x faster (~190 ticks for filterfir vs ~44 ticks for convolve on a intel core i7 870). Based on the filterfir documentation, I expected the opposite behaviour. Am I missing or misunderstanding something?

Igor pro 64 bit 6.34A, windows 7

Thanks,
Fabrizio
Sorry, this should work:
make/o/d coefs
filterfir/lo={0.3,0.31,201}/coef coefs
make/o/d/n=1e7 data
variable tim
tim = ticks; filterfir/coef=coefs data; tim = ticks-tim; print tim
tim = ticks; convolve coefs, data; tim = ticks-tim; print tim


- Fabrizio
fabrizio wrote:
Hi,

According to the 'filterfir' documentation,
FilterFIR filters data faster than Convolve when there are many fewer filter coefficient values than data points in waveName.
However [...] the convolve operation is ~4x faster (~190 ticks for filterfir vs ~44 ticks for convolve on a intel core i7 870). Based on the filterfir documentation, I expected the opposite behaviour. Am I missing or misunderstanding something?


The promise of faster speed is vague on purpose; many factors come into play.

FilterFIR uses only time-domain convolution, which is a straightforward sum of products.

Convolve conditionally uses segmented overlapped FFTs when it thinks it will be faster (and often is).

FilterFIR is faster only when the number of coefficients is quite small, around 23 points in your example.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.