diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-15 23:04:23 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-15 23:04:23 +0200 |
| commit | 0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (patch) | |
| tree | d702795f99ac38e0cc17e25f0f7e50fa3e05baf9 /lib/fil4.f90 | |
| parent | 310d05acf2c9233f7e336ae7dd9ffb7b54ca4e62 (diff) | |
New upstream version 3.0.0~rc1+repackupstream/3.0.0_rc1+repack
Diffstat (limited to 'lib/fil4.f90')
| -rwxr-xr-x | lib/fil4.f90 | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/lib/fil4.f90 b/lib/fil4.f90 index 4946da2f..3649bf40 100755 --- a/lib/fil4.f90 +++ b/lib/fil4.f90 @@ -1,49 +1,49 @@ -subroutine fil4(id1,n1,id2,n2) - -! FIR lowpass filter designed using ScopeFIR - -! fsample = 48000 Hz -! Ntaps = 49 -! fc = 4500 Hz -! fstop = 6000 Hz -! Ripple = 1 dB -! Stop Atten = 40 dB -! fout = 12000 Hz - - parameter (NTAPS=49) - parameter (NDOWN=4) !Downsample ratio - integer*2 id1(n1) - integer*2 id2(*) - real t(NTAPS) - data t/NTAPS*0.0/ - -! Filter coefficients: - real w(NTAPS) - data w/ & - 0.000861074040, 0.010051920210, 0.010161983649, 0.011363155076, & - 0.008706594219, 0.002613872664,-0.005202883094,-0.011720748164, & - -0.013752163325,-0.009431602741, 0.000539063909, 0.012636767098, & - 0.021494659597, 0.021951235065, 0.011564169382,-0.007656470131, & - -0.028965787341,-0.042637874109,-0.039203309748,-0.013153301537, & - 0.034320769178, 0.094717832646, 0.154224604789, 0.197758325022, & - 0.213715139513, 0.197758325022, 0.154224604789, 0.094717832646, & - 0.034320769178,-0.013153301537,-0.039203309748,-0.042637874109, & - -0.028965787341,-0.007656470131, 0.011564169382, 0.021951235065, & - 0.021494659597, 0.012636767098, 0.000539063909,-0.009431602741, & - -0.013752163325,-0.011720748164,-0.005202883094, 0.002613872664, & - 0.008706594219, 0.011363155076, 0.010161983649, 0.010051920210, & - 0.000861074040/ - save w,t - - n2=n1/NDOWN - if(n2*NDOWN.ne.n1) stop 'Error in fil4' - k=1-NDOWN - do i=1,n2 - k=k+NDOWN - t(1:NTAPS-NDOWN)=t(1+NDOWN:NTAPS) !Shift old data down in array t - t(1+NTAPS-NDOWN:NTAPS)=id1(k:k+NDOWN-1) !Insert new data at end of t - id2(i)=nint(dot_product(w,t)) - enddo - - return -end subroutine fil4 +subroutine fil4(id1,n1,id2,n2)
+
+! FIR lowpass filter designed using ScopeFIR
+
+! fsample = 48000 Hz
+! Ntaps = 49
+! fc = 4500 Hz
+! fstop = 6000 Hz
+! Ripple = 1 dB
+! Stop Atten = 40 dB
+! fout = 12000 Hz
+
+ parameter (NTAPS=49)
+ parameter (NDOWN=4) !Downsample ratio
+ integer*2 id1(n1)
+ integer*2 id2(*)
+ real t(NTAPS)
+ data t/NTAPS*0.0/
+
+! Filter coefficients:
+ real w(NTAPS)
+ data w/ &
+ 0.000861074040, 0.010051920210, 0.010161983649, 0.011363155076, &
+ 0.008706594219, 0.002613872664,-0.005202883094,-0.011720748164, &
+ -0.013752163325,-0.009431602741, 0.000539063909, 0.012636767098, &
+ 0.021494659597, 0.021951235065, 0.011564169382,-0.007656470131, &
+ -0.028965787341,-0.042637874109,-0.039203309748,-0.013153301537, &
+ 0.034320769178, 0.094717832646, 0.154224604789, 0.197758325022, &
+ 0.213715139513, 0.197758325022, 0.154224604789, 0.094717832646, &
+ 0.034320769178,-0.013153301537,-0.039203309748,-0.042637874109, &
+ -0.028965787341,-0.007656470131, 0.011564169382, 0.021951235065, &
+ 0.021494659597, 0.012636767098, 0.000539063909,-0.009431602741, &
+ -0.013752163325,-0.011720748164,-0.005202883094, 0.002613872664, &
+ 0.008706594219, 0.011363155076, 0.010161983649, 0.010051920210, &
+ 0.000861074040/
+ save w,t
+
+ n2=n1/NDOWN
+ if(n2*NDOWN.ne.n1) stop 'Error in fil4'
+ k=1-NDOWN
+ do i=1,n2
+ k=k+NDOWN
+ t(1:NTAPS-NDOWN)=t(1+NDOWN:NTAPS) !Shift old data down in array t
+ t(1+NTAPS-NDOWN:NTAPS)=id1(k:k+NDOWN-1) !Insert new data at end of t
+ id2(i)=nint(dot_product(w,t))
+ enddo
+
+ return
+end subroutine fil4
|
