Mercurial > dsp > rdsp
comparison src/lib/signal/filesource.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 | 2d5ae243921c |
children |
comparison
equal
deleted
inserted
replaced
23:2d5ae243921c | 24:daa09aecdc40 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> | 2 * Copyright (c) 2020-2021 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
3 * | 3 * |
4 * Permission is hereby granted, free of charge, to any person obtaining a copy | 4 * Permission is hereby granted, free of charge, to any person obtaining a copy |
5 * of this software and associated documentation files (the "Software"), to deal | 5 * of this software and associated documentation files (the "Software"), to deal |
6 * in the Software without restriction, including without limitation the rights | 6 * in the Software without restriction, including without limitation the rights |
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
57 | 57 |
58 fn sample_size(&self) -> usize { | 58 fn sample_size(&self) -> usize { |
59 U::sample_size() | 59 U::sample_size() |
60 } | 60 } |
61 | 61 |
62 fn sample_shift(&self) -> u64 { | |
63 0 | |
64 } | |
65 | |
62 fn freq(&self) -> u64 { | 66 fn freq(&self) -> u64 { |
63 self.freq | 67 self.freq |
64 } | |
65 | |
66 fn phase_shift(&self) -> u64 { | |
67 0 | |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 impl<T: BufRead, U: SignalFormatter> Iterator for FileSourceSignal<T, U> { | 71 impl<T: BufRead, U: SignalFormatter> Iterator for FileSourceSignal<T, U> { |
72 type Item = IQSample; | 72 type Item = IQSample; |