]> git.sesse.net Git - c64tapwav/blobdiff - decode.cpp
Fix an off-by-two in the filter cutoff.
[c64tapwav] / decode.cpp
index b2878feb0e0a993c4ce37dc616c7f4453f8bbf73..ef8630de9948532f66e324d82a35485f74e24aa9 100644 (file)
@@ -1,3 +1,6 @@
+// Copyright Steinar H. Gunderson <sgunderson@bigfoot.com>
+// Licensed under the GPL, v2. (See the file COPYING.)
+
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
@@ -339,7 +342,7 @@ std::vector<float> do_rc_filter(const std::vector<float>& pcm, float freq, int s
 {
        std::vector<float> filtered_pcm;
        filtered_pcm.resize(pcm.size());
-       Filter filter = Filter::hpf(M_PI * freq / sample_rate);
+       Filter filter = Filter::hpf(2.0 * M_PI * freq / sample_rate);
        for (unsigned i = 0; i < pcm.size(); ++i) {
                filtered_pcm[i] = filter.update(pcm[i]);
        }