Re: [music-dsp] resampling

2018-07-25 Thread Tom O'Hara


On 7/26/2018 2:27 AM, rolfsassin...@web.de wrote:
Regarding Tom's remark:  Using the copied samples also requires no 
additional multiplcation since the value is already stored and in use (?)


No, they require multiplication and addition as, while the samples are 
the same, each coefficient is different.  A zero x coefficient = zero, 
so no need to multiply or add.


Tom

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

Re: [music-dsp] resampling

2018-07-24 Thread Tom O'Hara
Adding zeros is an advantage as then you don't need to calculate their 
multiplication, as 0 x coefficient = 0


The filter order will be the same with zeros or repeated samples.

Tom


On 7/24/2018 4:37 PM, rolfsassin...@web.de wrote:

Hello Nigel
could you please say a word more to what you mean by "2x", "3x"?

Also I am again not sure why in this case, adding zeros is an 
advantage. I had expected to just copy the samples to have less work 
to do in filtering. I tested such things in MATLAB and found that 
feeding zeros needs more filter TAPs to come to the same result.

Rolf
*Gesendet:* Montag, 23. Juli 2018 um 18:25 Uhr
*Von:* "Nigel Redmon" 
*An:* music-dsp@music.columbia.edu
*Betreff:* Re: [music-dsp] resampling
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.


 
	Virus-free. www.avg.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


___
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] Blend two audio

2018-06-18 Thread Tom O'Hara

On 6/18/2018 6:42 PM, gm wrote:


I find that in practice a cosine/sine fade works very well for 
uncorrelated signals.


Likewise.

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



Re: [music-dsp] Changing Biquad filter coefficients on-the-fly, how to handle filter state?

2016-03-03 Thread Tom O'Hara


4.  the only problem with the filter cross-fade scheme is knowing how 
long to wait before you can ping-pong back to the other filter.  it's 
like you have two filters running simultaneously on the same input 
with ostensibly the same coefficients (most of the time) so their 
outputs should be the same.  then you change the coefficients in the 
"inactive" filter, wait for the transient to pass and then cross-fade 
over to it (which makes it the "active" filter).  or you could slew 
the inactive filter to the target values and wait a very little amount 
of time before cross-fading.  i dunno.  sounds like that could work 
and i have never done it.


I copy the old coefficients and states to the spare filter, and new 
coefficients and states to the normal filter, then crossfade them at 
both the inputs and outputs using a sin/cos, as cos^2 + sin^2 = 1. As 
this is in a mixer, I have one spare filter for six normal filters, 
after the crossfade time the spare filter is freed.


This works much better than just a linear fade at the outputs, which I 
have also done.


I use a 10mS fade time.

Tom

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



Re: [music-dsp] IIR Coefficient Switching Issues

2013-11-05 Thread Tom O'Hara


On 04-Nov-13 18:10, Phil Burk wrote:

A different approach is to have two filters in parallel. You can be
listening to one while setting up the other. When the other filter is
stable just cross-fade from one to the other.


And cross-fade both the input and output with a sine/cosine after 
zeroing the states of the new filter.


Tom


--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp


Re: [music-dsp] stereo-wide pan law?

2012-02-07 Thread Tom O'Hara

L = ((1+w)L + (1-w)R)/2
R = ((1+w)R + (1-w)L)/2

0=w=2

0 = mono
1 = normal
2 = full wide

Tom


On 07-Feb-12 11:20, Ross Bencina wrote:

Hi Everyone,

Does anyone know if there's a standard way to calculate pan laws for
stereo-wide panning ?

By stereo-wide I mean panning something beyond the speakers by using
180-degree shifted signal in the opposite speaker. For example, for
beyond hard left you would output full gain signal to the left
speaker, and some inverted phase signal to the right speaker.

I know this is a somewhat dubious method but I'm wondering if there
are known pan laws that handle this case.

Thank you,

Ross.
--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book
reviews, dsp links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp


--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp