Applying a filter function

I have an L point filter flt which I need to apply to an array fin length N, the result being stored in fout. The filter will start shifting until one gets to the last element of fin.

How can I do this. I ma getting quite confused. :wall:

I got an array of indices ixa and ixb which give the start and end elements I need to apply the flt with.

For example

I can have a 7 point filter and a 1500 point array fin of data values.
Suppose I have ixa(7)=5 and ixb(7)=10. The filter always has an odd number of elements.

This means that for output position 7, I need to use elements 5 through 10 of fin.
Now the centre of the filter flt(4) should be centred at location ix as shown below.

for ix = 7, ixa(7)=5, ixb(7)=10

So I need to do

fout(7) = flt(2) * fin(5) + flt(3) * fin(6) + flt(4) * fin(7) + flt(5) * fin(8) + flt(6) * fin(9) + flt(7) * fin(10)

I have started doing a loop on each element of the output, example, but getting very confused.

do ix = 1, N
    do k = ixa(ix), ixb(ix)
        fout(ix) = fout(ix) + flt(?) * fin(k)
    enddo
enddo

what language is this?

Fortran. But C will also do for me. The ? shows my confusion.