aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-21 05:27:53 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-21 05:27:53 +0100
commit9d721b584dfed6f5f31461b6bcefe81e41f8295f (patch)
tree122efd055e4720329f7903d4699a53c2e749533f /src
parentGoertzel algorithm (diff)
downloadfodtmf-9d721b584dfed6f5f31461b6bcefe81e41f8295f.tar.gz
fodtmf-9d721b584dfed6f5f31461b6bcefe81e41f8295f.tar.bz2
fodtmf-9d721b584dfed6f5f31461b6bcefe81e41f8295f.tar.xz
reorder parameters
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src')
-rw-r--r--src/goertzel.c4
-rw-r--r--src/goertzel.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/goertzel.c b/src/goertzel.c
index 41fd897..d7ab641 100644
--- a/src/goertzel.c
+++ b/src/goertzel.c
@@ -20,14 +20,14 @@
-void goertzel_init(double freq, double rate, struct goertzel_state* restrict state)
+void goertzel_init(struct goertzel_state* restrict state, double freq, double rate)
{
memset(state, 0, *state);
state->k = 2 * cos(2 * M_PI * (freq / rate));
}
-double goertzel(size_t n, const uint32_t* restrict samples, struct goertzel_state* restrict state)
+double goertzel(struct goertzel_state* restrict state, const uint32_t* restrict samples, size_t n)
{
double power, samp, s;
size_t i;
diff --git a/src/goertzel.h b/src/goertzel.h
index ad1e4b8..385df22 100644
--- a/src/goertzel.h
+++ b/src/goertzel.h
@@ -29,6 +29,6 @@ struct goertzel_state
};
-void goertzel_init(double freq, double rate, struct goertzel_state* restrict state);
-double goertzel(size_t n, const uint32_t* restrict samples, struct goertzel_state* restrict state);
+void goertzel_init(struct goertzel_state* restrict state, double freq, double rate);
+double goertzel(struct goertzel_state* restrict state, const uint32_t* restrict samples, size_t n);