[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
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

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 detected by 
comparing with
this threshold value. But if there is a phase discontinuity it will be hard to 
detect.

-ben


From: Benny Alexandar 
Sent: Wednesday, January 10, 2018 10:21 PM
To: Spencer Jackson; music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Finding discontinuity in a sine wave.


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 detected by 
comparing with
this threshold value. But if there is a phase discontinuity it will be hard to 
detect.

-ben


From: music-dsp-boun...@music.columbia.edu 
 on behalf of Spencer Jackson 

Sent: Wednesday, January 10, 2018 10:04 PM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Finding discontinuity in a sine wave.

If the sine frequency is known, perhaps you could use a goertzel filter and 
compare a average signal power calculation to measure the power of the error 
signal.

That doesn't identify the nature of the error, but strikes me as an interesting 
approach.
_spencer

On Wed, Jan 10, 2018 at 9:23 AM, Eric Brombaugh 
mailto:ebrombau...@cox.net>> wrote:
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 detect any discontinuities such as audio gap, fading, phase 
discontinuity etc.

Any algorithms available on time domain other than doing FFT based approach ?

-ben


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

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 detected by 
comparing with
this threshold value. But if there is a phase discontinuity it will be hard to 
detect.

-ben


From: music-dsp-boun...@music.columbia.edu 
 on behalf of Spencer Jackson 

Sent: Wednesday, January 10, 2018 10:04 PM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Finding discontinuity in a sine wave.

If the sine frequency is known, perhaps you could use a goertzel filter and 
compare a average signal power calculation to measure the power of the error 
signal.

That doesn't identify the nature of the error, but strikes me as an interesting 
approach.
_spencer

On Wed, Jan 10, 2018 at 9:23 AM, Eric Brombaugh 
mailto:ebrombau...@cox.net>> wrote:
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 detect any discontinuities such as audio gap, fading, phase 
discontinuity etc.

Any algorithms available on time domain other than doing FFT based approach ?

-ben


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

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: music-dsp-boun...@music.columbia.edu 
 on behalf of Ethan Fenn 

Sent: Wednesday, January 10, 2018 10:33 PM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Finding discontinuity in a sine wave.

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 10, 2018 at 11:58 AM, STEFFAN DIEDRICHSEN 
mailto:sdiedrich...@me.com>> wrote:
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 
mailto:ben.a...@outlook.com>> wrote:

 But if there is a phase discontinuity it will be hard to detect.



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

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

2018-01-11 Thread Benny Alexandar
Any idea on finding mismatch in an audio signal ( music)  given a reference 
audio and a delayed
audio signal as inputs to the system. Correlation is the way to find, can we 
rely on this method
for a music signal .Any other methods ?

-ben

From: music-dsp-boun...@music.columbia.edu 
 on behalf of Henrik von Coler 

Sent: Thursday, January 11, 2018 3:48 AM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Finding discontinuity in a sine wave.


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 
discontinuity etc.

Any algorithms available on time domain other than doing FFT based approach ?

-ben



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp


--
Henrik von Coler
Elektronisches Studio, Fachgebiet Audiokommunikation
Electronic Music Studio, Audio Communication Group

Technische Universität Berlin
Fakultät I Geistes- und Bildungswissenschaften
Institut für Sprache und Kommunikation

Faculty I Humanities
Institute of Speech and Communication

Einsteinufer 17c, Sekr. EN 8, 10587 Berlin
Germany
Tel: +49 (0)30 314 22327
Fax: +49 (0)30 314 21143
vonco...@tu-berlin.de<mailto:vonco...@tu-berlin.de>

www.ak.tu-berlin.de<http://www.ak.tu-berlin.de>
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

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

2018-01-11 Thread Benny Alexandar
Hi Ethan,

This looks interesting. Suppose I have a single tone sound getting mixed with 
audio,
can we find that tone frequency and have an adaptive notch filter ?

Does your above equation works in identifying a fixed frequency tone ?
For example by doing (x(t) + x(t-2)) / (2*x(t-1)) can we isolate a
single tone frequency  ?

-ben


From: Ethan Fenn 
Sent: Thursday, January 11, 2018 12:13 AM
To: Benny Alexandar
Cc: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Finding discontinuity in a sine wave.

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 and are careful about the singularity when x(t-1) is close to 0, then 
we've got a simple adaptive notch. And we can get a running estimate of the 
frequency by computing arccos(C).

-Ethan



On Wed, Jan 10, 2018 at 12:47 PM, Benny Alexandar 
mailto:ben.a...@outlook.com>> wrote:
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: 
music-dsp-boun...@music.columbia.edu<mailto:music-dsp-boun...@music.columbia.edu>
 
mailto:music-dsp-boun...@music.columbia.edu>>
 on behalf of Ethan Fenn mailto:et...@polyspectral.com>>
Sent: Wednesday, January 10, 2018 10:33 PM
To: music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
Subject: Re: [music-dsp] Finding discontinuity in a sine wave.

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 10, 2018 at 11:58 AM, STEFFAN DIEDRICHSEN 
mailto:sdiedrich...@me.com>> wrote:
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 
mailto:ben.a...@outlook.com>> wrote:

 But if there is a phase discontinuity it will be hard to detect.



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] Audacity & Jack audio

2018-01-13 Thread Benny Alexandar
Hi,

I'm looking for this post below link, which is not available currently.
This is about using Audacity audio editor and 
 Jackaudio working together.

Please  help me to get the post on below link

http://music.columbia.edu/pipermail/linux-audio-user/2005-July/024519.html


-ben
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] Clock drift and compensation

2018-01-23 Thread Benny Alexandar
Hi All,

I have  a problem to solve,

I have  a system which has a tuner chip and DSP chip, both are clocked by 
independent
xtals. Tuner gives the baseband samples to DSP, and tuner is master and dsp is 
slave.

Dsp does the demodulation of base band samples and does the audio decoding and
generate audio, which is streamed out from DSP.

Now if the tuner xtal is drifting then the dsp audio streaming needs to adjust 
to that
drift, else buffer overflow or underrun happens as the sample rates doesn't 
match.

How to design a control system such that a digital baseband frame of duration
'T' ms is mapped to audio and adjust the drift ?

-ben

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Clock drift and compensation

2018-01-25 Thread Benny Alexandar
Hi,

Apparently there are no timing information being broadcast and no meta data 
fields available for getting these like in mpeg TS.

The only way is to find the symbol boundary and time stamp it, since the tuner 
is feeding the base band samples  to
DSP, if any tuner variations will be reflected in the timing of symbols in DSP. 
Monitor this difference and adjust audio clock
in DSP, which is possible in hardware of DSP.

This is what I'm planning to implement, please find the attached figure,

Now the timing of input side is after detecting the start of symbol. Every 
symbol will be timestamped and  measure the time deviation between two symbols.

d = t1 -  t0,
where t0 - time of arrival of symbol (n)
 t1 - time of arrival of symbol (n+1)
  d - time deviation between two symbols.

D - time duration between two symbols according to digital radio standards, 
then  error =  ( D / d )  -  1

Please send your suggestions feedback regarding this approach.

-ben

From: music-dsp-boun...@music.columbia.edu 
 on behalf of Andy Farnell 

Sent: Wednesday, January 24, 2018 2:17 AM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Clock drift and compensation

On Tue, Jan 23, 2018 at 04:17:40PM +0000, Benny Alexandar wrote:

> How to design a control system such that a digital baseband frame of duration
> 'T' ms is mapped to audio and adjust the drift ?

A classic asynchronous resampling problem. Look at something like
SMPTE drop frame resampling using div/modulo to calculate the
number of frames of m samples over which to interpolate to get
some new number of n samples.

Real problem is that you need to know the difference/drift
in the clocks. Is there some feature in your signal that helps
with this?



> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Clock drift and compensation

2018-01-28 Thread Benny Alexandar
Hi GM,

>> HT -> Atan2 -> differenciate -> unwrap
Could you please explain how to find the drift using HT,

HT -> gives real(I) & imaginary (Q) components of real signal
Atan2 -> the phase of an I Q signal
diff-> gives what ?
unwrap ?

-ben



From: music-dsp-boun...@music.columbia.edu 
 on behalf of gm 
Sent: Saturday, January 27, 2018 5:20 PM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Clock drift and compensation


I don't understand your project at all so not sure if this is helpful,
probably not,
but you can calculate the drift or instantanous frequency of a sine wave
on a per sample basis
using a Hilbert transform
HT -> Atan2 -> differenciate -> unwrap
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Clock drift and compensation

2018-01-29 Thread Benny Alexandar
Hi GM,

Thanks for the suggestion. Yes, it should work for sine tone kind of signals.

I have this doubt on sampling and drift.

 - Suppose transmitter is sampling a sine tone say  (Fin) 1KHz at 8kHZ (Fs) 
sample rate.
This means 8 samples should correspond to one cycle of 1 kHz.

- Receiver is sampling at 7.999 kHz  because of drift in crystal,
but I'm thinking my receiver is having a sample rate of 8kHz and takes 8 
samples for one cycle.
which gives  999.875 Hz and not 1kHz.

So, how to detect this drift and take only that many samples for the 
corresponding receiver sample rate.
in this case 7.999 samples corresponds to 1 kHz.

-ben


From: music-dsp-boun...@music.columbia.edu 
 on behalf of gm 
Sent: Monday, January 29, 2018 1:29 AM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Clock drift and compensation


diff gives you the phase step per sample,
basically the frequency.

However the phase will jump back to zero periodically when the phase exceeds 
360°
(when it wraps around) in this case diff will get you a wrong result.

So you need to "unwrap" the phase or the phase difference, for example:


diff = phase_new - phase_old
if phase_old > Pi and phase_new < Pi then diff += 2Pi

or similar.

Am 28.01.2018 um 17:19 schrieb Benny Alexandar:
Hi GM,

>> HT -> Atan2 -> differenciate -> unwrap
Could you please explain how to find the drift using HT,

HT -> gives real(I) & imaginary (Q) components of real signal
Atan2 -> the phase of an I Q signal
diff-> gives what ?
unwrap ?

-ben



From: 
music-dsp-boun...@music.columbia.edu<mailto:music-dsp-boun...@music.columbia.edu>
 
<mailto:music-dsp-boun...@music.columbia.edu>
 on behalf of gm <mailto:g...@voxangelica.net>
Sent: Saturday, January 27, 2018 5:20 PM
To: music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
Subject: Re: [music-dsp] Clock drift and compensation


I don't understand your project at all so not sure if this is helpful,
probably not,
but you can calculate the drift or instantanous frequency of a sine wave
on a per sample basis
using a Hilbert transform
HT -> Atan2 -> differenciate -> unwrap
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Clock drift and compensation

2018-02-05 Thread Benny Alexandar
Hi Robert,

Yes, I need to do ASRC, and the challenge is how to estimate the drift
and correct it.

As I mentioned in the earlier attached figure, DSP is slave and tuner chip 
feeds the baseband samples and is the master.
Now the question is where to do the timestamping for correctly estimate the 
drift.
The system is an embedded platform having a tuner chip and DSP chip, both have 
independent oscillators ( Xtal)  for providing the clock.
So my question is how to timestamp the audio data. After channel decoder the 
compressed audio will have variable decoding times
based on audio content. So this is not a good place to timestamp as it is very 
jittery.

Suppose every digital radio transmission frame duration T seconds  corresponds 
to T seconds of audio, can I timestamp the
baseband RF IQ samples when it arrives at the DSP ?   After demodulation and 
audio decoder calculate the max delay it can
have for worst case scenarios, and add that as target delay before playing out. 
Then while playing out each audio period
read the current time, the difference of current time - ( RF packet arrival 
time + Target Delay) should be ideally zero,
if audio plays out at the same rate as transmission of audio,.

-ben



From: music-dsp-boun...@music.columbia.edu 
 on behalf of robert bristow-johnson 

Sent: Monday, February 5, 2018 1:01 PM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Clock drift and compensation


Ben, can you confirm that what you want to do is Asynchronous Sample
Rate Conversion (ASRC)?  this is what Steffan is talking about and what
it looked like you were looking for in your first post.

If ASRC is what you wanna do, that is a combination of the SRC task
(like what is done to a sound file when you change the sample rate of
it) and servo systems like you get in control theory, like what is done
in a phase-lock loop (like hurrying up or slowing down based on the
delay).  If you wanna write your own code to do this, it's about those
two general DSP and digital control problems.  you will need to be able
to read a fast system clock (like what profilers read) to do this really
well.

r b-j

On 1/28/18 1:16 PM, STEFFAN DIEDRICHSEN wrote:
> Actually, there are SRC chips available from Texas Instruments, just
> take look at their website. They don’t cost too much and are found in
> countless digital mixing consoles.
>
> Best,
>
> Steffan
>
> Von meinem iPhone gesendet
>
>
>
> Von meinem iPhone gesendet
> Am 28.01.2018 um 17:19 schrieb Benny Alexandar  <mailto:ben.a...@outlook.com>>:
>
>> Hi GM,
>>
>> >> HT -> Atan2 -> differenciate -> unwrap
>> Could you please explain how to find the drift using HT,
>>
>> HT -> gives real(I) & imaginary (Q) components of real signal
>> Atan2 -> the phase of an I Q signal
>> diff-> gives what ?
>> unwrap ?
>>
>> -ben
>>
>>
>> 
>> *From:* music-dsp-boun...@music.columbia.edu
>> <mailto:music-dsp-boun...@music.columbia.edu>
>> > <mailto:music-dsp-boun...@music.columbia.edu>> on behalf of gm
>> mailto:g...@voxangelica.net>>
>> *Sent:* Saturday, January 27, 2018 5:20 PM
>> *To:* music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
>> *Subject:* Re: [music-dsp] Clock drift and compensation
>>
>> I don't understand your project at all so not sure if this is helpful,
>> probably not,
>> but you can calculate the drift or instantanous frequency of a sine wave
>> on a per sample basis
>> using a Hilbert transform
>> HT -> Atan2 -> differenciate -> unwrap
>> ___
>> dupswapdrop: music-dsp mailing list
>> music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
>> https://lists.columbia.edu/mailman/listinfo/music-dsp
>>
>> ___
>> dupswapdrop: music-dsp mailing list
>> music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
>> https://lists.columbia.edu/mailman/listinfo/music-dsp
>
>
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp


--

r b-j  r...@audioimagination.com

"Imagination is more important than knowledge."



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Reading a buffer at variable speed

2018-02-06 Thread Benny Alexandar
>> The buffer must be read at a variable speed,

Do you mean it has to be played out at higher sample rates ?

>> how long will it take to play the whole buffer

If you can derive an average rate out of it then you can determine it.

-ben


From: music-dsp-boun...@music.columbia.edu 
 on behalf of Maximiliano Estudies 

Sent: Tuesday, February 6, 2018 8:15 PM
To: music-dsp@music.columbia.edu
Subject: [music-dsp] Reading a buffer at variable speed

I am having trouble with this concept for quite some time now, I hope that I 
can explain it well enough so you can understand what I mean.
I have signal stored in a buffer of known length. The buffer must be read at a 
variable speed, and the variations in speed have to be exponential, so that the 
resulting glissandi are (aurally) linear. In order to do that I came up with 
the following formula:

x[t] = t * sample_rate * end_speed^(x[t] / T) where T is the total length 
of the buffer in samples.

This doesn’t seem to work and I can’t understand why.

And my second question is, how can I get the resulting length in milliseconds? 
(how long will it take to play the whole buffer)

I hope I managed to be clear enough!

Maxi

--
Maximiliano Estudies
+49 176 36784771
maxiestudies.com
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Clock drift and compensation

2018-03-09 Thread Benny Alexandar
Hi GM,
Instead of finding Hilbert transform, I tried with just finding the angle 
between samples
of a fixed frequency sine wave.
I tried to create a sine wave of  frequency x[n] = sin ( 2 * pi * 1/4 * n), and 
tried calculating the angle between samples,
it should be 90 degree. This also can be used to detect any discontinuity in 
the signal.
Below is the octave code which I tried.

One cycle of sine wave consists of 4 samples, two +ve and two -ve.

% generate the sine wave of frequency 1/4
for i = 1 : 20
   x(i) = sin( 2 * pi * ( 1 / 4) * i);
end

% find the angle between samples in degrees.
 for i = 1:20
ang(i)  =  asin( x(i) ) * (180 / pi);
 end

% find the absolute difference between angles
for i = 1:20
 diff(i) =  abs( ang( i + 1 ) - ang( i ));
end

% check for discontinuity
for i = 1:20
if (diff(i) != 90)
  disp("discontinuity")
endif
end


Please verify this logic is correct for discontinuity check.

-ben




From: music-dsp-boun...@music.columbia.edu 
 on behalf of gm 
Sent: Monday, January 29, 2018 1:29 AM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Clock drift and compensation


diff gives you the phase step per sample,
basically the frequency.

However the phase will jump back to zero periodically when the phase exceeds 
360°
(when it wraps around) in this case diff will get you a wrong result.

So you need to "unwrap" the phase or the phase difference, for example:


diff = phase_new - phase_old
if phase_old > Pi and phase_new < Pi then diff += 2Pi

or similar.

Am 28.01.2018 um 17:19 schrieb Benny Alexandar:
Hi GM,

>> HT -> Atan2 -> differenciate -> unwrap
Could you please explain how to find the drift using HT,

HT -> gives real(I) & imaginary (Q) components of real signal
Atan2 -> the phase of an I Q signal
diff-> gives what ?
unwrap ?

-ben



From: 
music-dsp-boun...@music.columbia.edu<mailto:music-dsp-boun...@music.columbia.edu>
 
<mailto:music-dsp-boun...@music.columbia.edu>
 on behalf of gm <mailto:g...@voxangelica.net>
Sent: Saturday, January 27, 2018 5:20 PM
To: music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
Subject: Re: [music-dsp] Clock drift and compensation


I don't understand your project at all so not sure if this is helpful,
probably not,
but you can calculate the drift or instantanous frequency of a sine wave
on a per sample basis
using a Hilbert transform
HT -> Atan2 -> differenciate -> unwrap
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Clock drift and compensation

2018-03-09 Thread Benny Alexandar
Hi GM,

My application is to capture an analog sine tone  through PC sound card and 
check for discontinuity, glitch, audio gap, attenuation etc.

Please suggest any other reliable methods for this analysis.

-ben

From: music-dsp-boun...@music.columbia.edu 
 on behalf of gm 
Sent: Saturday, March 10, 2018 1:20 AM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Clock drift and compensation


The problem I see is that your sine wave needs to have a precise amplitude for 
the arcsine.
I don't understand your application so I don't know if this is the case.


Am 09.03.2018 um 19:58 schrieb Benny Alexandar:
Hi GM,
Instead of finding Hilbert transform, I tried with just finding the angle 
between samples
of a fixed frequency sine wave.
I tried to create a sine wave of  frequency x[n] = sin ( 2 * pi * 1/4 * n), and 
tried calculating the angle between samples,
it should be 90 degree. This also can be used to detect any discontinuity in 
the signal.
Below is the octave code which I tried.

One cycle of sine wave consists of 4 samples, two +ve and two -ve.

% generate the sine wave of frequency 1/4
for i = 1 : 20
   x(i) = sin( 2 * pi * ( 1 / 4) * i);
end

% find the angle between samples in degrees.
 for i = 1:20
ang(i)  =  asin( x(i) ) * (180 / pi);
 end

% find the absolute difference between angles
for i = 1:20
 diff(i) =  abs( ang( i + 1 ) - ang( i ));
end

% check for discontinuity
for i = 1:20
if (diff(i) != 90)
  disp("discontinuity")
endif
end


Please verify this logic is correct for discontinuity check.

-ben




From: 
music-dsp-boun...@music.columbia.edu<mailto:music-dsp-boun...@music.columbia.edu>
 
<mailto:music-dsp-boun...@music.columbia.edu>
 on behalf of gm <mailto:g...@voxangelica.net>
Sent: Monday, January 29, 2018 1:29 AM
To: music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
Subject: Re: [music-dsp] Clock drift and compensation


diff gives you the phase step per sample,
basically the frequency.

However the phase will jump back to zero periodically when the phase exceeds 
360°
(when it wraps around) in this case diff will get you a wrong result.

So you need to "unwrap" the phase or the phase difference, for example:


diff = phase_new - phase_old
if phase_old > Pi and phase_new < Pi then diff += 2Pi

or similar.

Am 28.01.2018 um 17:19 schrieb Benny Alexandar:
Hi GM,

>> HT -> Atan2 -> differenciate -> unwrap
Could you please explain how to find the drift using HT,

HT -> gives real(I) & imaginary (Q) components of real signal
Atan2 -> the phase of an I Q signal
diff-> gives what ?
unwrap ?

-ben



From: 
music-dsp-boun...@music.columbia.edu<mailto:music-dsp-boun...@music.columbia.edu>
 
<mailto:music-dsp-boun...@music.columbia.edu>
 on behalf of gm <mailto:g...@voxangelica.net>
Sent: Saturday, January 27, 2018 5:20 PM
To: music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
Subject: Re: [music-dsp] Clock drift and compensation


I don't understand your project at all so not sure if this is helpful,
probably not,
but you can calculate the drift or instantanous frequency of a sine wave
on a per sample basis
using a Hilbert transform
HT -> Atan2 -> differenciate -> unwrap
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] Audio glitch gap detection

2018-03-12 Thread Benny Alexandar
Hi,
I want to develop an algorithm which after capturing  an analog sine tone  
through PC sound card check for discontinuity, glitch, audio gap, attenuation 
etc.

Please suggest any other reliable methods for this analysis. The sine tone is 
of fixed frequency which is known prior

-ben
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] Blend two audio

2018-06-16 Thread Benny Alexandar
Hi,

I'm looking for an algorithm to blend two audio.  My requirement is
given tow identical audio inputs say A1 & A2.
A1 is ahead of A2 by t sec, when switch from A1 to A2
it should be seamless and vice versa.

-ben

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Blend two audio

2018-06-16 Thread Benny Alexandar
Please share the link of cross fade.

-ben

From: music-dsp-boun...@music.columbia.edu 
 on behalf of Matt Ingalls 
Sent: Saturday, June 16, 2018 11:27 PM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Blend two audio

A short (~50ms) cross-fade should be fine.

I may be reading too much into your question, but if
t is continually changing (user is adjusting a delay tap, for example),
a nice trick I’ve done is to cache the new t value until the crossfade finishes,
Then start a new crossfade, etc..  this prevents clicking and pitch changing 
artifacts
-m

On Jun 16, 2018, at 10:45 AM, Benny Alexandar 
mailto:ben.a...@outlook.com>> wrote:

Hi,

I'm looking for an algorithm to blend two audio.  My requirement is
given tow identical audio inputs say A1 & A2.
A1 is ahead of A2 by t sec, when switch from A1 to A2
it should be seamless and vice versa.

-ben

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Blend two audio

2018-06-20 Thread Benny Alexandar
Hi Nigel,

The delay will be estimated one time in the beginning and it remains constant. 
After that the audio which is ahead is buffered for that much.
When switching it has to align so that after switching to other audio, it 
should be glitch free and seamless meaning user should not notice the switching.

For eg: two same audio sources one a(t) and other a(t + T) where T is the delay 
between the two audio.

-ben

From: music-dsp-boun...@music.columbia.edu 
 on behalf of Nigel Redmon 

Sent: Tuesday, June 19, 2018 4:44 AM
To: music-dsp@music.columbia.edu
Subject: Re: [music-dsp] Blend two audio

Suggestions of crossfading techniques, but I’m not convinced that solves the 
problem the OP posed:

"given [two] identical audio inputs...A1 is ahead of A2 by t sec, when switch 
from A1 to A2...it should be seamless”

If the definition of “seamless” is glitch-free, crossfading will solve it. But 
then why mention “identical" and “ahead”?

I think he’s talking about synchronization. And it’s unclear whether t is known.


On Jun 16, 2018, at 10:45 AM, Benny Alexandar 
mailto:ben.a...@outlook.com>> wrote:

Hi,

I'm looking for an algorithm to blend two audio.  My requirement is
given tow identical audio inputs say A1 & A2.
A1 is ahead of A2 by t sec, when switch from A1 to A2
it should be seamless and vice versa.

-ben

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp