[music-dsp] WSOLA on Real Time

2018-07-23 Thread Alex Dashevski
Hi.

I'm looking for a simple explanation and implementation of WSOLA. I tried
to google it but I can't understand all meaning of inputs and outputs that
WSOLA has.
My goal is to implement it in Real time on Android. Possibly, to use pitch
shifting in Real Time.

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

Re: [music-dsp] resampling

2018-07-23 Thread Alex Dashevski
Hi,
I need to do resampling on android.
Could you give me code on c/c++/Java?

On Tue, Jul 24, 2018, 08:56 Tom O'Hara  wrote:

> I've done many resamplers over the decades (48<->32, 24,16,8) and always
> used FIRs for these reasons.
>
> Tom
>
> On 7/23/2018 6:25 PM, Nigel Redmon wrote:
> > Some articles on my website:
> >
> http://www.earlevel.com/main/category/digital-audio/sample-rate-conversion/,
>
> > especially the 2010 articles, but the Amp Sim article might be a
> > helpful overview.
> >
> > 48k -> 8k: Filter with a lowpass with cutoff below 4k; keep 1 sample,
> > throw away 5, repeat.
> >
> > 8k -> 48k: Use 1 sample, follow it with 5 new samples of 0 value,
> > repeat; filter with a lowpass filter with cutoff below 4k.
> >
> > Nuances:
> >
> > A linear phase FIR is a popular choice for the lowpass filter (odd
> > length, Kaiser windowed sinc is a good choice). In downsampling, you
> > don’t have to calculate the samples you intend to discard, and in
> > upsampling, you don’t need to do the operations for added 0-valued
> > samples.
> >
> > You want the filter stop band (above 4k) to have suitable attenuation
> > (Kaiser is nice for this, because you can specify it, trading off with
> > transition sharpness).
> >
> > Advance topic: You can optimize performance by doing it in two stages
> > (3x, 2x). You win by noting that the first stage doesn’t have to be
> > perfect, and long as the second stage cleans up after it.
> >
>
> ___
> 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] resampling

2018-07-23 Thread Tom O'Hara
I've done many resamplers over the decades (48<->32, 24,16,8) and always 
used FIRs for these reasons.


Tom

On 7/23/2018 6:25 PM, Nigel Redmon wrote:
Some articles on my website: 
http://www.earlevel.com/main/category/digital-audio/sample-rate-conversion/, 
especially the 2010 articles, but the Amp Sim article might be a 
helpful overview.


48k -> 8k: Filter with a lowpass with cutoff below 4k; keep 1 sample, 
throw away 5, repeat.


8k -> 48k: Use 1 sample, follow it with 5 new samples of 0 value, 
repeat; filter with a lowpass filter with cutoff below 4k.


Nuances:

A linear phase FIR is a popular choice for the lowpass filter (odd 
length, Kaiser windowed sinc is a good choice). In downsampling, you 
don’t have to calculate the samples you intend to discard, and in 
upsampling, you don’t need to do the operations for added 0-valued 
samples.


You want the filter stop band (above 4k) to have suitable attenuation 
(Kaiser is nice for this, because you can specify it, trading off with 
transition sharpness).


Advance topic: You can optimize performance by doing it in two stages 
(3x, 2x). You win by noting that the first stage doesn’t have to be 
perfect, and long as the second stage cleans up after it.




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

Re: [music-dsp] resampling

2018-07-23 Thread Nigel Redmon
Some articles on my website: 
http://www.earlevel.com/main/category/digital-audio/sample-rate-conversion/ 
, 
especially the 2010 articles, but the Amp Sim article might be a helpful 
overview.

48k -> 8k: Filter with a lowpass with cutoff below 4k; keep 1 sample, throw 
away 5, repeat.

8k -> 48k: Use 1 sample, follow it with 5 new samples of 0 value, repeat; 
filter with a lowpass filter with cutoff below 4k.

Nuances:

A linear phase FIR is a popular choice for the lowpass filter (odd length, 
Kaiser windowed sinc is a good choice). In downsampling, you don’t have to 
calculate the samples you intend to discard, and in upsampling, you don’t need 
to do the operations for added 0-valued samples.

You want the filter stop band (above 4k) to have suitable attenuation (Kaiser 
is nice for this, because you can specify it, trading off with transition 
sharpness).

Advance topic: You can optimize performance by doing it in two stages (3x, 2x). 
You win by noting that the first stage doesn’t have to be perfect, and long as 
the second stage cleans up after it.


> On Jul 19, 2018, at 11:15 AM, Alex Dashevski  wrote:
> 
> Hi,
> 
> I need to convert 48Khz to 8KHz on input and convert 8Khz to 48Khz on audio 
> on output.
> Could you explain how to do it ?
> I need to implement this on android(NDK).
>  
> Thanks,
> Alex

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

Re: [music-dsp] resampling

2018-07-23 Thread Felix Homann
libsamplerate, aka Secret Rabbit Code, has been relicensed under a 2 clause
BSD license a while ago. Maybe you want to give it a try:

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

Re: [music-dsp] What is resonance?

2018-07-23 Thread Vadim Zavalishin

On 20-Jul-18 18:13, Mehdi Touzani wrote:

So... how do you do a resonance in a lowpass circuit?   :-)   not the
math, not the code, just the architecture.


There are many different ways to create resonance in a lowpass circuit
(esp. if the order is larger than 2). The higher is the order of the
filter, the more different answers there are.

Making a feedback loop around a lowpass chain is one way, but AFAIK it
works perfectly (or close to that) only for the 4th order filter (the so
called Moog ladder). I'm not aware of any standard generic structure (or
even a transfer function to begin with) which could be referred to as a
generic Nth order resonating filter. Recently I tried to propose one way
of generalizing the 2nd order resonance to an arbitrary order by what I
called "Butterworth filters of the 2nd kind", but this involves just the
transfer function, whereas you still have lots of freedom in the
implementation structure. You could look into the latest revision of my
book for more details (where I also explain the problems with the
lowpass feedback).

Regards,
Vadim


--
Vadim Zavalishin
Reaktor Application Architect
Native Instruments GmbH
+49-30-611035-0

www.native-instruments.com

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



Re: [music-dsp] resampling

2018-07-23 Thread Kjetil Matheussen
On Mon, Jul 23, 2018 at 3:08 AM, Henrik G. Sundt  wrote:

> This solution, without using any low pass filters before and after the
> desimation, will generate a lot of aliasing frequencies, Kjetil!
>
> Here is another solution:
> https://github.com/intervigilium/libresample/tree/master/jni/resample
>
>
For linear interpolation, here is a version that's easier to read:

currReadPos = 2.0;
prevVal = 0.0;
nextVal = 0.0;

float getOutputSample(){
  while(currReadPos > 1.0){
currReadPos-=1.0;
prevVal=nextVal;
nextVal=getInputSample();
  }
  float ret = prevVal + currReadPos * (nextVal-prevVal);
  currReadPos += (input_samplerate / output_samplerate);

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

Re: [music-dsp] resampling

2018-07-23 Thread Kjetil Matheussen
On Mon, Jul 23, 2018 at 3:08 AM, Henrik G. Sundt  wrote:

> This solution, without using any low pass filters before and after the
> desimation, will generate a lot of aliasing frequencies, Kjetil!
>
>
No doubt. I did write "Not the best sound quality though." :-)
Alex didn't write about his knowledge level etc., so I just showed the
simplest resampler, in case it would be useful.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] What is resonance?

2018-07-23 Thread David Reaves
In the physical world, resonance can generally be observed as the 
frequency-dependent cyclic exchanging of energy between potential (stored) and 
kinetic (active) forms. A pendulum is a basic example: at either end of its 
swing a pendulum exhibits purely its maximal stored potential energy while 
momentarily there is zero (kinetic) motion; at mid-swing there is no storage 
(potential) and all energy is kinetic, in motion. Each form of energy has two 
opposing modes: potential has the two opposite extremes of the swing; kinetic, 
the two different directions of swing. The amplitudes of the two forms of 
energy are in quadrature, a 90° cyclic relationship; when charted, the two 
energy levels trace out sine and cosine forms. 

In the real world, when continually given new energy with proper timing, a 
pendulum will swing indefinitely. If the outside source of energy is taken 
away, the resonance will decay: friction (resistance; damping) will slow and 
eventually stop the swinging. Within the limits of swing amplitude, the 
frequency of the pendulum's motion remains the same.

If you see such a back-and-forth, energy-trading relationship, there is likely 
resonance going on. Freezing can possibly be seen as energy storage and 
stretching can possibly be seen as activity, but unless one ‘feeds' the other 
and vice-versa, it’s probably not resonance.

(I will be pleased if someone corrects any false assumption I have made.)

David Reaves


On Sun, 22 Jul 2018 22:05:48 -0400 charles morrow mailto:c...@cmorrow.com>> wrote:
> 
> How about freezing and stretching moments. Is this resonance?

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