fix mcpha/filters/fir_0.r
@@ -6,7 +6,7 @@ a2 <- 0.14128
a3 <- 0.01168
x <- seq(0.0, 1.0, by = 1 / 40)
h <- a0 - a1 * cos(2 * pi * x) + a2 * cos(4 * pi * x) - a3 * cos(6 * pi * x)
-h <- B/sum(B)
+h <- h / sum(h)
# Print filter coefficients
paste(sprintf("%.10e", h), collapse = ", ")
@@ -19,5 +19,4 @@ plot(fh$f / pi, abs(fh$h), type = "l", ylab = "magnitude", xlab = "Frequency", x
plot(fh$f / pi, 20*log10(abs(fh$h)+1e-5), type = "l", ylab = "dB", xlab = "Frequency", xlim = c(0, 0.2))
-
par(op)
