Mercurial > dsp > rdsp
diff src/lib/signal.rs @ 24:daa09aecdc40 default tip
lib: rename phase_shift to sample_shift
Instead of tracking the phase shift in signals, we should track the sample
shift (i.e., delay) of the signal. The sample shift is a constant
regardless of the frequency - unlike phase shift. This simplifies the
tracking considerably.
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Thu, 15 Apr 2021 22:26:06 -0400 |
parents | 3b3a643069bd |
children |
line wrap: on
line diff
--- a/src/lib/signal.rs Wed Jun 10 12:29:27 2020 -0400 +++ b/src/lib/signal.rs Thu Apr 15 22:26:06 2021 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> + * Copyright (c) 2020-2021 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,8 +41,8 @@ Self: Sized { fn sample_rate(&self) -> u64; fn sample_size(&self) -> usize; + fn sample_shift(&self) -> u64; fn freq(&self) -> u64; - fn phase_shift(&self) -> u64; fn shift_freq(self, delta: i64) -> Mixer<Self, Sinusoid> { let rate = self.sample_rate();