diff options
| -rw-r--r-- | fir_window_hamming.awk | 5 | ||||
| -rw-r--r-- | kalman_init.awk | 4 | ||||
| -rw-r--r-- | ludcmp.awk | 6 | ||||
| -rw-r--r-- | mean_avg.awk | 2 |
4 files changed, 10 insertions, 7 deletions
diff --git a/fir_window_hamming.awk b/fir_window_hamming.awk index 5660754..51eb0d8 100644 --- a/fir_window_hamming.awk +++ b/fir_window_hamming.awk @@ -5,6 +5,9 @@ # R.W. Hamming, 'Digital Filters': H = '0.23 0.54 0.23'
# https://en.wikipedia.org/wiki/Window_function provides a few values for the
# 'a0' and 'a1' parameters of the raised cosine.
+# note: the forms provided from wikipedia do not give expected results and
+# appear to show inconsistency between raised cosine variations. need to
+# cross-check these forms against DSP/signaling texts.
# Hamming window (raised cosine)
@@ -26,7 +29,7 @@ BEGIN { # window interval goes from -M to M
M = 0.5*(N - 1)
- pi = 4*atan2(1,1)
+ pi = 4.0*atan2(1.0,1.0)
for (n=-M; n<=M; n++) {
if (N > 1 && M > 0) {
diff --git a/kalman_init.awk b/kalman_init.awk index 757d80b..fae1501 100644 --- a/kalman_init.awk +++ b/kalman_init.awk @@ -27,7 +27,7 @@ NF > 0 { (NF > nf_max) ? nf_max = NF : nf_max = nf_max # columns - for (n=1; n<=max_nf; n++) { + for (n=1; n<=nf_max; n++) { if ($n ~ number) { count[n] = ($n ~ number) + (last[n] ~ number) + (last2[n] ~ number) diff[n] = $n - last[n] @@ -46,7 +46,7 @@ NF > 0 { } # error covariance - for (m=1; m<=max_nf; m++) { + for (m=1; m<=nf_max; m++) { count[m,n]++ sum_xy[m,n] += 1 delta_xy[m,n] = delta[m]*delta[n] @@ -66,13 +66,13 @@ NR == 1 { # read input data NF { - if (NF > max_nf) + if (NF > nf_max) (NF > nf_max) ? nf_max = NF : nf_max = nf_max for (n=1; n<=NF; n++) { if ($n ~ number) { count[n] += 1 - (count[n] == 1 || max_nf > size) ? size = max_nf : size = size + (count[n] == 1 || nf_max > size) ? size = nf_max : size = size (count[n] == 1 || count[n] > size) ? size = count[n] : size = size matrix[count[n],n] = $n print(matrix[count[n],n]) @@ -83,7 +83,7 @@ NF { END { printf(ORS) - print(NR, max_nf, size) + print(NR, nf_max, size) printf(ORS) lu_decomp(matrix, size) } diff --git a/mean_avg.awk b/mean_avg.awk index 05c93f1..bf40b43 100644 --- a/mean_avg.awk +++ b/mean_avg.awk @@ -46,7 +46,7 @@ NF > 0 { END { print "col", "mean", "std_err", "std_dev", "range", "min", "max", "total", "count" - for (n=1; n<=max_nf; n++) { + for (n=1; n<=nf_max; n++) { if (header[n]) print header[n], mean[n], sqrt(var[n]/count[n]), sqrt(var[n]), range[n], min[n], max[n], mean[n]*count[n], count[n] else |
