History

Improve octave scripts used for calculating filers.

Erik de Castro Lopo committed 22 years ago

Commit 3770b8e1 parent b9e50b52 files · +6 −6Browse files

Unified · Split

2 files
  1. make_src_filter.m +5 −5
  2. measure_filter.m +1 −1
make_src_filter.m+5−5
@@ -22,12 +22,12 @@ elseif (isstr (filename) == 0), · 21 unmodified lines
22fudge_factor1 = 1.0 ;22fudge_factor1 = 1.0 ;
23f1 = generate_filter (cycles, fudge_factor1, increment, atten) ;23f1 = generate_filter (cycles, fudge_factor1, increment, atten) ;
24[stop_atten stop_band_start1 minus_3db] = measure_filter (f1, atten) ;24[stop_atten stop_band_start1 minus_3db] = measure_filter (f1, atten) ;
25printf (" fudge_factor : %10.8f stop_band_start : %10.8f 1\n", fudge_factor1, stop_band_start1) ;25printf (" fudge_factor : %15.13f stop_band_start : %15.13f 1\n", fudge_factor1, stop_band_start1) ;
26 26
27fudge_factor2 = 1.25 ;27fudge_factor2 = 1.25 ;
28f2 = generate_filter (cycles, fudge_factor2, increment, atten) ;28f2 = generate_filter (cycles, fudge_factor2, increment, atten) ;
29[stop_atten stop_band_start2 minus_3db] = measure_filter (f2, atten) ;29[stop_atten stop_band_start2 minus_3db] = measure_filter (f2, atten) ;
30printf (" fudge_factor : %10.8f stop_band_start : %10.8f 2\n", fudge_factor2, stop_band_start2) ;30printf (" fudge_factor : %15.13f stop_band_start : %15.13f 2\n", fudge_factor2, stop_band_start2) ;
31 31
32f = f1 ;32f = f1 ;
33fudge_factor = fudge_factor1 ;33fudge_factor = fudge_factor1 ;
@@ -35,7 +35,7 @@ stop_band_start = stop_band_start1 ; · 1 unmodified line
35 35
36while ((stop_band_start1 - stop_band_start2) > 0.00000001)36while ((stop_band_start1 - stop_band_start2) > 0.00000001)
37 if (stop_band_start1 < stop_band_start2)37 if (stop_band_start1 < stop_band_start2)
38 printf ("stop_band_start1 < stop_band_start2") ;38 printf ("stop_band_start1 < stop_band_start2\n") ;
39 break ;39 break ;
40 endif40 endif
41 41
@@ -44,7 +44,7 @@ while ((stop_band_start1 - stop_band_start2) > 0.00000001) · 2 unmodified lines
44 [stop_atten stop_band_start minus_3db] = measure_filter (f, atten) ;44 [stop_atten stop_band_start minus_3db] = measure_filter (f, atten) ;
45 45
46 if (stop_band_start > 1.0)46 if (stop_band_start > 1.0)
47 printf ("%10.8f %10.8f %10.8f\n", fudge_factor1, fudge_factor, fudge_factor2) ;47 printf ("A %10.8f %10.8f %10.8f\n", fudge_factor1, fudge_factor, fudge_factor2) ;
48 continue ;48 continue ;
49 endif49 endif
50 50
@@ -60,7 +60,7 @@ while ((stop_band_start1 - stop_band_start2) > 0.00000001) · 9 unmodified lines
60 choice = 1 ;60 choice = 1 ;
61 endif61 endif
62 62
63 printf (" fudge_factor : %10.8f stop_band_start : %10.8f %d\n", fudge_factor, stop_band_start, choice) ;63 printf (" fudge_factor : %15.13f stop_band_start : %15.13f %d\n", fudge_factor, stop_band_start, choice) ;
64 endwhile64 endwhile
65 65
66printf ("\n") ;66printf ("\n") ;
measure_filter.m+1−1
@@ -1,7 +1,7 @@
1function [stop_atten stop_band_start minus_3db] = measure_filter (f, atten)1function [stop_atten stop_band_start minus_3db] = measure_filter (f, atten)
2 2
3 3
4spec_len = 200000 ;4spec_len = 400000 ;
5 5
6# Calculate the spectrum.6# Calculate the spectrum.
7 7

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t