Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread gm
Isn't a clock drift indistinguishable from a drift in your input signal? I'd use a feed forward combfilter btw Am 10.01.2018 um 18:47 schrieb Benny Alexandar: This all works well in an ideal system. Suppose the sampling clock is drifting slowly over period of time, then the notch filter will

Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread Benny Alexandar
This all works well in an ideal system. Suppose the sampling clock is drifting slowly over period of time, then the notch filter will fail to filter it. How to detect and correct these clock drifts and have a stable notch filter. -ben From:

Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread Ethan Fenn
Well, starting with the FIR filter I proposed, let's take this equality: 0 = x(t) - 2*C*x(t-1) + x(t-2) If we don't know exactly what our frequency is, we can solve for C: C = (x(t) + x(t-2)) / (2*x(t-1)) Of course we don't want to take just one computation of C, but if we do some averaging

Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread STEFFAN DIEDRICHSEN
A notch filter would serve you well, if the sine wave doesn’t change its frequency. Steffan > On 10.01.2018|KW2, at 17:08, Benny Alexandar wrote: > > Hi, > > I want to do some time domain analysis on a sine wave signal which is > continuously streaming. > My

Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread Z Eric Zhang
Yeah a notch filter could remove the main sine tone provided it is of high enough order to be a precise notch, and anything else you hear left over could be detection of errors / artifacts as any discontinuity would result in spurious frequency content. Not sure how it could help with phase

Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread Eric Brombaugh
Maybe try locking a PLL to the sinewave to get the expected frequency and phase, then look for differences between them? Eric On 01/10/2018 09:08 AM, Benny Alexandar wrote: Hi, I want to do some time domain analysis on a sine wave signal which is continuously streaming. My objective is to

Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread Z Eric Zhang
You could take a synthesized in-phase sine tone with the same frequency at the destination and subtract it from the streamed signal that has arrived, and compare the output. Any non-zero sample will mean an error. -ez From: music-dsp-boun...@music.columbia.edu

[music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread Benny Alexandar
Hi, I want to do some time domain analysis on a sine wave signal which is continuously streaming. My objective is to detect any discontinuities such as audio gap, fading, phase discontinuity etc. Any algorithms available on time domain other than doing FFT based approach ? -ben

Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread Benny Alexandar
Here is what I was planning. The sine wave frequency is known. For example if sine wave is having a frequency of 1 kHz and sampling rate is 48 kHz. Then every 48 samples will make one full cycle. Find the norm of this 48 samples. It should remain constant, if any fading, mute etc will be

Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread STEFFAN DIEDRICHSEN
With any phase discontinuity, a spectral discontinuity is delivered for free. So, the notch filter will have an output, a PPL would need to re-sync, etc. Steffan > On 10.01.2018|KW2, at 17:51, Benny Alexandar wrote: > > But if there is a phase discontinuity it will

Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread Spencer Russell
I think the PLL approach will be much more robust, and will let you detect phase changes. -s On Wed, Jan 10, 2018, at 11:51 AM, Benny Alexandar wrote: > Here is what I was planning. The sine wave frequency is known. > > For example if sine wave is having a frequency of 1 kHz and sampling >

Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread Ethan Fenn
If the sine frequency is f and the sample rate is sr: Let C = cos(2*pi*f/sr) For each sample compute: y(t) = x(t) - 2*C*x(t-1) + x(t-2) y(t) should be 0 for every t... if not it indicates a discontinuity. This is just an FIR filter with a zero at the given frequency. -Ethan On Wed, Jan

Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread Henrik von Coler
For actual discontinuities, the derivative should be helpful - G H On 10.01.2018 17:08, Benny Alexandar wrote: Hi, I want to do some time domain analysis on a sine wave signal which is continuously streaming. My objective is to detect any discontinuities such as audio gap, fading, phase