Applying a filter function


 
Thread Tools Search this Thread
Top Forums Programming Applying a filter function
# 1  
Old 01-14-2011
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. Smilie

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.

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

# 2  
Old 01-16-2011
what language is this?
# 3  
Old 01-16-2011
Fortran. But C will also do for me. The ? shows my confusion.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Debian

Applying patch for Samba version 4.1.17

The version of Samba in our billing server is 4.1.17-Debian. I have been reminded by our management to implement the patch for Samba on this server. However, I am not sure how to implement the patch. I have browsed some websites for the correct patch to implement for Samba 4.1.17, and the patch... (11 Replies)
Discussion started by: anaigini45
11 Replies

2. Ubuntu

Recompile the kernel after applying a patch in Ubuntu.

I have applied a patch using this command: patch -p1 < (file) then I did git commit -a. Now I want to recompile the kernel for making this patch live. Should I use make oldconfig or make localmodconfig After that, make -j$(grep -c "processor" /proc/cpuinfo) sudo make... (1 Reply)
Discussion started by: BHASKAR JUPUDI
1 Replies

3. Shell Programming and Scripting

Help need in applying logic in one script

Hello Experts, (1 Reply)
Discussion started by: shams.abbazi@gm
1 Replies

4. UNIX for Dummies Questions & Answers

Applying python on all the files in one folder --UNIX

Dear all, I know this might be a simple and silly question but I am struggling with it I have a long unix script and in a section of if I want to use a python script which should select all the files and run the script on it (as a whole) the loop I have is selecting file by file and I dont know... (2 Replies)
Discussion started by: A-V
2 Replies

5. UNIX for Dummies Questions & Answers

Applying awk

I have a file that is formatted like this: ======== aaaa 11111 bbbb 2222 cccc 3333 ============ dddd 4444 eeee 5555 ffff 6666 ============ trying to get the file to look like this: ====== aaaa aaaa 1111 aaaa bbbb 2222 aaaa cccc 3333 ============= dddd dddd 4444 dddd... (2 Replies)
Discussion started by: jimmyf
2 Replies

6. Solaris

Problem with SMC after applying Patchset 1-148888-03

Here is the problem: I have several servers that now have been updated from PatchSet # 147440-19 to PatchSet # 148888-03. The servers range from: (1) SunFire T2000 (3) Enterprise T5140 (2) Enterprise T5220 Solaris 10 08/11 u10 on 1 and u7 on the others. After the patch is applied I... (7 Replies)
Discussion started by: Wraith_G2IC
7 Replies

7. AIX

applying patches in aix 5.3

Hi Admins, Basically i am HPUX guy.HP will release patch bundles every three months and the same we are applying on servers as proactive steps. Please let me know how it happens with AIX. My servers are AIX 5.3 with TL 10 and some are TL 7. These servers are installed 2 years back and... (1 Reply)
Discussion started by: newaix
1 Replies

8. Programming

Applying filters

I have a value X, a value DX and an odd integer N (say N=9) and want to create an array such that let X = 10, DX = 2 and N = 9 DIST(1) = X - 4 * DX DIST(2) = X - 3 * DX DIST(3) = X - 2 * DX DIST(4) = X - DX DIST(5) = X DIST(6) = X + DX DIST(7) = X + 2 * DX DIST(8) = X + 3 * DX DIST(9)... (2 Replies)
Discussion started by: kristinu
2 Replies

9. Shell Programming and Scripting

connect to remote server by applying password

Hi , I am new to shell script. I have to write a shell script which will login to remote server then check for the space there. There 50 remote ervers all are having different password. Could you please suggest me some way. I am working on solaris box. Thanks in advance (2 Replies)
Discussion started by: vikash_k
2 Replies
Login or Register to Ask a Question