Page 1 of 2
hilbert transform in green array (for statistics)
Posted: Mon May 30, 2016 8:58 am
by tester
I have an equation that looks like this:
"function" + iH("function")
where "function" is a green array of data, triggered from time to time. In the schematic this part will occur multiple times, so I guess I should avoid too many ruby windows, that's why I want to make it in green.
While I see there is a hilbert transform described as a set of allpass filters in blue - I'm not sure how to convert it into static greens. Or is there another way? If I understand, hilbert processor is an approximation. I need it for statistical equations, so I'm guessing it has to be relatively accurate (at least matlab level or so).
Can someone post how it should looks like?
Martin? KG?
Re: hilbert transform in green array (for statistics)
Posted: Mon May 30, 2016 12:53 pm
by tester
Following this topic:
viewtopic.php?f=3&t=3175&start=10#p17132I created something like this, but I have no idea whether this is correct or not. Did I created sort of green hilbert transform here?
Help please.
Re: hilbert transform in green array (for statistics)
Posted: Mon May 30, 2016 10:37 pm
by tester
Hmm... it's possible that it's not correct...
Re: hilbert transform in green array (for statistics)
Posted: Tue May 31, 2016 2:22 pm
by tester
Yess! Works.
The above scchematic, despite minor error (1 sample earlier missing in size) - works correctly. But - the array is in reversed order. so the impulse array should have number 1 at the end.
So, final question - is the above schematic - proper hilbert transform for statistics?
...Martin?
Re: hilbert transform in green array (for statistics)
Posted: Tue May 31, 2016 8:45 pm
by martinvicanek
tester wrote:So, final question - is the above schematic - proper hilbert transform for statistics?
You can easily check yourself: If you feed the Hilbert transformer with a cosine of arbitrary frequency, the result is a sine (90 degrees phase shift). Same amplitude, same frequency.
Re: hilbert transform in green array (for statistics)
Posted: Tue May 31, 2016 9:26 pm
by tester
Martin, I actually did this in the meantime (I connected sine osc and played with the frequency), and... there are some problems.
While my array conversion works correctly, there is a problem with reference setup(s).
The reference setup does not keeps equal amplitude in regards to unprocessed sine. As far I remember from my second computer, the amplitude change is 2x per 2x frequency change, so this appears to be log curve in freq domain. I''m guessing, that I could use some correction green filter, but I don't know what one. Plus, there is a problem, i.e. it isn't keeping 90-degree shift across the spectra, but I'm not sure to what degree (need to re-check it). I don't know if this is acceptable for signal statistics.
So I tested your setup with paired 2-pole filters. I'm not sure how to interpret it in green, but I'm guessing these "in2 to in1 to in" and "out2 to out1 to out" relationships - represent 2-sample delay (2 value shift in array used with itself). But your setup creates hilbert transform and it affects input signal on first channel, so the first channel maybe keeps 90-degree difference to hilbertian, but has also a shift in regards to unprocessed input at certain frequencies, and again - it's probably not good for statistics made on green static data.
Can you shed some light on it?
Re: hilbert transform in green array (for statistics)
Posted: Tue May 31, 2016 9:39 pm
by martinvicanek
You could actually use the stream hilbert transformer with a signal analyzer at its output. You need to convert the input as well: green array to mem, then wave read.
Re: hilbert transform in green array (for statistics)
Posted: Tue May 31, 2016 10:23 pm
by tester
Could you post a scheme? Also, what would be important - is proper boundary handling (since there is some delay), to avoid artifacts in resulting statistical data.
But anyway, what I'm not sure about - is whether what fits here acoustic needs - is appropriate enough for statistics. I don't have a background for an opinion. Guys from the paper used some matlab default approximation if I understand correctly.
*
Martin, I also need some hints on how to solve these equations related to resulting hilbert:
download/file.php?id=5919There is a sentence that says that real and imaginary part must be calculated separately, so I'm guessing this says that two arrays should be processed independently, somehow.
There is this "d" parameter calculated (not sure if "a" = "alpha", or whether this is something else somehow related to alpha), and in the context of above - the only thing that comes to my mind, is that both arrays - should be just moved through abs primitive, to have all values positive inside the array. If not - then I don't know how to mix it and still have 2 arrays.
In last equation (C2), "d" is used as "complex conjugate", so if I understand it correctly - sign for data in imaginary array is just changed to minus?
Then if I understand correctly, "d*" is multiplied by "a" (and some other stuff), so it will produce two arrays, so the sum is made on two arrays separately, and then divided by what's on the bottom?
Re: hilbert transform in green array (for statistics)
Posted: Tue May 31, 2016 10:44 pm
by tester
attaching some reference schematics, fixed version (works in terms of reference filter) and some signal tests on blue.
Re: hilbert transform in green array (for statistics)
Posted: Wed Jun 01, 2016 10:54 am
by tester
As for these complex numbers, I made some assumptions, so correct me.
the "a" refers to filter 1, and "d" is used for filter 2, anc cross-correlations are calculated.
I assumed that a = x1 + iy1, where x1 and iy1 are simply these two arrays coming out of hilbert transform.
I assumed, that d for x2,iy2 is calculated as:
(x + iy)^2 / (x^2 + y^2)^0.5
thus we get:
(x^2 - y^2) /(x^2 + y^2)^0.5 for the real array
plus
i2xy / /(x^2 + y^2)^0.5 for the imaginary array
and the sign for second d-array is changed to minus, to get teh complex conjugate part (x+iy to x-iy) for second equation.
As for the second equation, first let's calculate
a1 * 'd2
where
a1 are (x1 + iy1) arrays from filter 1
'd2 are (x2 - iy2) arrays from filter 2 (sign change because the complex conjugate is used)
thus
(x1 + iy1)(x2 - iy2) =
(x1x2 + y1y2) for the real part array
plus i(x2y1 - x1y2) for the imaginary part array
then both arrays multiplied by w(t) factor
then both arrays pushed through sum array primitive
then both arrays divided by multiplication of sigmas which is also a real number.
.....is this correct?
above equations are in last section of attached schematics.
hilbert part requires rewrite, and I need few seconds to describe for what frequency ranges it is needed.