[music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread Ross Bencina
Hi Everyone, Suppose that I generate a time series x[n] as follows: >>> P is a constant value between 0 and 1 At each time step n (n is an integer): r[n] = uniform_random(0, 1) x[n] = (r[n] <= P) ? uniform_random(-1, 1) : x[n-1] Where "(a) ? b : c" is the C ternary operator that takes on the

[music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-16 Thread Martin Vicanek
Has this been answered yet? If not, I'll try a back-of-the-envelope derivation. Consider two consecutive samples. By definition, the probability for them to be equal is (1-P), else they will be different and perfectly uncorrelated. Hence the expected correlation between two consecutive sample

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread Ethan Duni
Do you mean the literal Fourier spectrum of some realization of this process, or the power spectral density? I don't think you're going to get a closed-form expression for the former (it has a random component). For the latter what you need to do is work out an expression for the autocorrelation fu

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread Ethan Duni
Wait, just realized I wrote that last part backwards. It should be: So in broad strokes, what you should see is a lowpass spectrum parameterized by P - for P very small, you approach a DC spectrum, and for P close to 1 you approach a spectrum that's flat. On Tue, Nov 3, 2015 at 10:26 AM, Ethan Du

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread robert bristow-johnson
dsp] how to derive spectrum of random sample-and-hold noise? From: "Ethan Duni" Date: Tue, November 3, 2015 1:29 pm To: "A discussion list for music-related DSP" -- > Wait, just realized I wro

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread Ross Bencina
On 4/11/2015 5:26 AM, Ethan Duni wrote: Do you mean the literal Fourier spectrum of some realization of this process, or the power spectral density? I don't think you're going to get a closed-form expression for the former (it has a random component). I am interested in the long-term magnitude

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread robert bristow-johnson
Original Message Subject: Re: [music-dsp] how to derive spectrum of random sample-and-hold noise? From: "Ross Bencina" Date: Tue, November 3, 2015 11:51 pm To: music-dsp@music.co

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread Ross Bencina
On 4/11/2015 9:39 AM, robert bristow-johnson wrote: i have to confess that this is hard and i don't have a concrete solution for you. Knowing that this isn't well known helps. I have an idea (see below). It might be wrong. it seems to me that, by this description: r[n] = uniform_random(0,

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread robert bristow-johnson
Original Message Subject: Re: [music-dsp] how to derive spectrum of random sample-and-hold noise? From: "Ross Bencina" Date: Wed, November 4, 2015 12:22 am To: r...@audioimagination.com music-dsp@music.co

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread robert bristow-johnson
Original Message Subject: Re: [music-dsp] how to derive spectrum of random sample-and-hold noise? From: "Ross Bencina" Date: Wed, November 4, 2015 12:22 am To: r...@audioimagination.com music-dsp@music.co

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread robert bristow-johnson
Original Message Subject: Re: [music-dsp] how to derive spectrum of random sample-and-hold noise? From: "Ross Bencina" Date: Wed, November 4, 2015 12:22 am To: r...@audioimagination.com music-dsp@music.co

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread robert bristow-johnson
Original Message Subject: Re: [music-dsp] how to derive spectrum of random sample-and-hold noise? From: "Ross Bencina" Date: Wed, November 4, 2015 12:22 am To: r...@audioimagination.com music-dsp@music.co

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-03 Thread Ethan Fenn
riginal Message > Subject: Re: [music-dsp] how to derive spectrum of random sample-and-hold > noise? > From: "Ross Bencina" > Date: Wed, November 4, 2015 12:22 am > To: r...@audioimagin

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-04 Thread Ethan Duni
It's pretty straightforward to derive the autocorrelation and psd for this one. Let me restate it with some convenient notation. Let's say there are a parameter P in (0,1) and 3 random processes: r[n] i.i.d. ~U(0,1) y[n] i.i.d. ~(some distribution with at least first and second moments finite) x[n]

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-04 Thread Ethan Duni
gt; > Does that make sense? > > -Ethan > > > > > > On Wed, Nov 4, 2015 at 8:21 AM, robert bristow-johnson < > r...@audioimagination.com> wrote: > >> >> >> ------------ Original Message >> Subje

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-04 Thread Theo Verelst
Ross Bencina wrote: Hi Everyone, Suppose that I generate a time series x[n] as follows: >>> P is a constant value between 0 and 1 At each time step n (n is an integer): r[n] = uniform_random(0, 1) x[n] = (r[n] <= P) ? uniform_random(-1, 1) : x[n-1] Where "(a) ? b : c" is the C ternary opera

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-05 Thread Ross Bencina
Thanks Ethan(s), I was able to follow your derivation. A few questions: On 4/11/2015 7:07 PM, Ethan Duni wrote: It's pretty straightforward to derive the autocorrelation and psd for this one. Let me restate it with some convenient notation. Let's say there are a parameter P in (0,1) and 3 rando

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-05 Thread Ethan Fenn
> > What is the method that you used to go from ac[k] to psd[w]? Robert > mentioned that psd was the Fourier transform of ac. Is this particular case > a standard transform that you knew off the top of your head? Yes, this is the Fourier transform of P^|k| (following Ethan D's notation). To deriv

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-05 Thread Ross Bencina
Thanks Ethan, I think that I have it working. It would be great is someone could check the scaling though. I'm not sure whether the FFT values should be fringing above the psd line or not: https://www.dropbox.com/s/txc0txhxqr1t274/SH1_2.png?dl=0 I removed the hamming window, which was causin

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-05 Thread Ethan Fenn
> > Let's see if I got this right: each bin contains the power for a frequency > interval of 2pi/N radians. If I multiply each bin's power by N/2pi I should > get power values in units of power/radian. > Sounds reasonable to me, but I'm not sure I've got it right so who knows! I think I was sligh

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-05 Thread Ethan Duni
>So for y[n] ~U(-1,1) I should multiply psd[w] by what exactly? The variance of y[n]. For U(-1,1) this is 1/3. From your subsequent post it sounds like you got this ironed out? >What is the method that you used to go from ac[k] to psd[w]? >Robert mentioned that psd was the Fourier transform of ac

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-05 Thread Ethan Duni
>since the whole signal has infinite power, the units really >need to be power per unit frequency per unit time, which >(confusingly) is the same thing as power. I think you mean to say "infinite energy" and then "energy per unit frequency per unit time," no? E On Thu, Nov 5, 2015 at 8:21 AM, Et

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-05 Thread Ethan Fenn
Yes, thank you! I guess most of the places I typed the word power I really meant energy... units are hard... -Ethan On Thu, Nov 5, 2015 at 7:33 PM, Ethan Duni wrote: > >since the whole signal has infinite power, the units really > >need to be power per unit frequency per unit time, which > >(c

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-05 Thread robert bristow-johnson
> I think I was slightly off when I said that the units of psd are power per > unit frequency -- since the whole signal has infinite power, � no, i don't think so. � > the units�really need to be power per unit frequency per unit time, which > (confusingly) is the same thing as power. � the

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-05 Thread Sampo Syreeni
On 2015-11-05, robert bristow-johnson wrote: I think I was slightly off when I said that the units of psd are power per unit frequency -- since the whole signal has infinite power, no, i don't think so. Me neither. Power is already by definition energy per unit time. Even if an infinitely

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-06 Thread Vadim Zavalishin
Apologies if this question has already been answered, I didn't read the entire thread, just wanted to share the following idea off the top of my head FWIW. Consider a random PCM signal whose period is equal to the SnH period. This is the same as discrete-time noise and, if I'm not mistaken, gi

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-06 Thread Vadim Zavalishin
On 06-Nov-15 11:03, Vadim Zavalishin wrote: Apologies if this question has already been answered, I didn't read the entire thread, just wanted to share the following idea off the top of my head FWIW. Oops, nevermind, I didn't realize that the SnH period is also random in the original question.

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-06 Thread Vadim Zavalishin
Okay, an updated idea. Represent the signal as a sum of time-shifted box functions of random amplitudes and durations. We assume that the sum is finite and then we can take the limit (if the values approach the infinity as the result, we can normalize them according to the length of the signal)

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-09 Thread Dan Stowell
Hi Ross, Just spotted this. I don't have an answer for you, but a possible helpful literature connection...? The system you describe is a simple Markov model. It's ergodic and time-homogeneous and reversible, and has no hidden state, so I'd guess that there must be results from the Markov model l

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-10 Thread Theo Verelst
In the course of these discussions, let's not forget the difference between a convolution with 1/(Pi*t) (a Hilbert transform kernel) and the inversion of the transfer function of a linear system. T. ___ dupswapdrop: music-dsp mailing list music-dsp@mu

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-10 Thread Sampo Syreeni
On 2015-11-04, robert bristow-johnson wrote: it is the correct way to characterize the spectra of random signals. the spectra (PSD) is the Fourier Transform of autocorrelation and is scaled as magnitude-squared. The normal way to derive the spectrum of S/H-noise goes a bit around these kinds

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-10 Thread Ethan Duni
>(Semi-)stationarity, I'd say. Ergodicity is a weaker condition, true, >but it doesn't then really capture how your usual L^2 correlative >measures truly work. I think we need both conditions, no? >Something like that, yes, except that you have to factor in aliasing. What aliasing? Isn't this pr

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-10 Thread robert bristow-johnson
Original Message Subject: Re: [music-dsp] how to derive spectrum of random sample-and-hold noise? From: "Ethan Duni" Date: Tue, November 10, 2015 8:58 pm To: "A discussion list for mu

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-11 Thread Ethan Duni
mption come from? E On Tue, Nov 10, 2015 at 6:33 PM, robert bristow-johnson < r...@audioimagination.com> wrote: > > > -------------------- Original Message ------------ > Subject: Re: [music-dsp] how to derive spectrum of random sample-and-hold > noise?

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-11 Thread robert bristow-johnson
Original Message Subject: Re: [music-dsp] how to derive spectrum of random sample-and-hold noise? From: "Ethan Duni" Date: Wed, November 11, 2015 5:57 pm To: "robert bristow-johnson" "A discussion l

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-11 Thread Ethan Duni
or making plots to verify that the answer is correct, > > but not needed just to derive the autocorrelation/spectrum themselves. > > > > i totally disagree. i consider this to be fundamental (and it's how i > remember doing statistical communication theory back in grad sc

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-11 Thread robert bristow-johnson
Original Message Subject: Re: [music-dsp] how to derive spectrum of random sample-and-hold noise? From: "Ethan Duni" Date: Wed, November 11, 2015 7:36 pm To: "robert bristow-johnson" "A discussion l

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-11 Thread Ethan Duni
he OP - where we were given an explicit description of a random signal - is in probabilistic terms using definitions of acf and psd in terms of expected value. E On Wed, Nov 11, 2015 at 5:02 PM, robert bristow-johnson < r...@audioimagination.com> wrote: > > > > ---------------

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-12 Thread Theo Verelst
Everywhere in the exact sciences there's the dualism between statistical analysis and deterministic engineering tools, since the major break through in quantum physics at the beginning of the 20th century. Whether that's some sort of diabolical duality or, as it actually is at the higher levels

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-16 Thread Martin Vicanek
Am 16.11.2015 20:00, schrieb Martin Vicanek: [..] the autocorrelation is = (1/3)*(1-P)^|k| (I checked that with a little MC code before posting.) So the power spectrum is (1/3)/(1 + (1-P)z^-1), i.e flat at DC and pink at higher frequencies. For reasonably small P the corner frequency is w_

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-16 Thread robert bristow-johnson
> Am 16.11.2015 20:00, schrieb Martin Vicanek: >> [..] the autocorrelation is >> >> = (1/3)*(1-P)^|k| >> >> (I checked that with a little MC code before posting.) So the power >> spectrum is (1/3)/(1 + (1-P)z^-1), i.e flat at DC and pink at higher >> frequencies. For reasonably small P

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-16 Thread Martin Vicanek
> well, pink is -3 dB/octave and red (a.k.a. brown) is -6 dB/octave. a roll-off of -12 > dB/octave would be very brown. -- r b-j Those values are for amplitudes - for a power spectrum the slopes double. ___ dupswapdrop: music-dsp mailing list music-ds

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-16 Thread robert bristow-johnson
Original Message Subject: Re: [music-dsp] how to derive spectrum of random sample-and-hold noise? From: "Martin Vicanek" Date: Mon, November 16, 2015 3:50 pm To: music-dsp@music.co

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-16 Thread Ethan Duni
>> [..] the autocorrelation is >> >> = (1/3)*(1-P)^|k| >> >> (I checked that with a little MC code before posting.) So the power >> spectrum is (1/3)/(1 + (1-P)z^-1) The FT of (1/3)*(1-P)^|k| is (1/3)*(1-Q^2)/(1-2Qcos(w) + Q^2), where Q = (1-P). Looks like you were thinking of the expression for

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-17 Thread Martin Vicanek
>/ > well, pink is -3 dB/octave and red (a.k.a. brown) is -6 dB/octave. a / >/ > roll-off of -12// dB/octave would be very brown. -- r b-j / >/ Those values are for amplitudes - for a power spectrum the slopes double. / no sir. not with dB. this is why we use dB = 20 * log10(ampli

Re: [music-dsp] how to derive spectrum of random sample-and-hold noise?

2015-11-18 Thread Theo Verelst
I don't recall the various chapters of Information Theory and practical digtial electronics or something about these kinds of power estimates, so I'm not putting this thread in some direction, except two small considerations. When the power of a signal is concerned, which in the continuous case