Dirk,
Good that you pointed it out. Actually i know very well that
trailing zeros are not needed. But this example illustrates
some im****tant aspects. I also know that adding zeros is
simplest way. But again this is DSP way of looking at the
delay line.
As a simple example if we have 9 tap LPFIR then we know for
sure that the group delay of this filter is 4. ((9-1)/2). And
this property can be used to create a delay line too. By
making all other coefficients "0" other than the center one.
Many digital designers do not understand the difference between
Latency and Group Delay. I think it is im****tant that a delay
line be thought as a very im****tant "DSP Element".
Regards
Bharat Pathak
Arithos Designs
www.Arithos.com
>On Oct 6, 1:45=A0pm, "bharat pathak" <bha...@[EMAIL PROTECTED]
> wrote:
>> For delay a simple matlab filter command will do.
>>
>> For example you had xin data which is set of random
>> numbers
>>
>> >> xin =A0=3D rand(1,100) =A0 =A0 =A0 =A0 =A0 =A0 % 100 random numbers
>> >> h =A0 =A0=3D [0 0 0 0 1 0 0 0 0] =A0 =A0 % 9 tap linear phase FIR
filt=
>er
>> >> xdel =3D filter(h, 1, xin) =A0 =A0 =A0 % xdel is 4 sample delayed
vers=
>ion of
>>
>> xin
>>
>> Regards
>> Bharat Pathak
>>
>> Arithos Designswww.Arithos.com
>>
>> DSP Design Consultancy and Training Company.
>>
>> Join us on 2 day workshop at Pune (India) On "Fundamentals of DSP
using
>> Matlab/Octave". This workshop is held on 18th and 19th Oct. For more
>> details send mail to bha...@[EMAIL PROTECTED]
>
>Bharat,
>
>In your example, the trailing zeros in the impulse response are
>unnecessary and almost double your computation, but for your MATLAB
>example, the simplest way to create a delayed array would be to add 4
>zeros to the beginning of the array, which would take care of the
>whole thing without using any filtering function.
>
>Dirk
>


|