Fred Marshall wrote:
> "Michel Rouzic" <Michel0528@yahoo.fr> wrote in message
> news:1142601336.925968.203810@i39g2000cwa.googlegroups.com...
> >
> > Fred Marshall wrote:
> >> "Michel Rouzic" <Michel0528@yahoo.fr> wrote in message
> >> news:1142570053.519282.56790@e56g2000cwe.googlegroups.com...
> >>
> >> > Here is the problem. I got my kernel, but the big question is, to what
> >> > do I amplify it. Because as I understand it, my problem is not in what
> >> > I do in the process of FFT convolution, but rather how I "amplify" my
> >> > kernel (since so far I was basing myself on having the sum of it's
> >> > values set to 1.0, which isn't a good idea in my case when the DC
> >> > element must be about 30 dB under the peak in the frequency domain)
> >> >
> >> > So, how do I set my kernel to the right amplitude? By setting the sum
> >> > of the magnitude bins in the frequency domain to some value based on
> >> > its length? The way I see it, if I set the sum of the magnitude bins to
> >> > be equal to the sum of the magnitude bins of a delta function of the
> >> > exact same length, I should get it right, right? (btw, I have no idea
> >> > on how to calculate the one value the magnitude bins for a delta
> >> > function based on its length)
> >>
> >> You got the filter by specifying the gain you wanted at each frequency or
> >> in
> >> each band, right? Then leave it alone... That is all you need to do.
> >> Nothing more.
> >> Then, if you decide you need 10dB more gain or less gain, adjust
> >> accordingly.
> >> Otherwise, you already have what you need.
> >
> > Well no. I got my filter by performing measurements, cross-coreelations
> > etc.. The original gain if ever I could get it by doing that got lost
> > in the mix. Plus, its pretty much a general purpose convolution
> > program, although most kernels used should have to be of the same kind
> > as the one i'm using right now, I could leave it up to myself/the user
> > to mess around with the kernel's scaling but honnestly i'd prefer some
> > automated thing, since a manual thing would result in a process of
> > trial in order to find what's the highest scaling possible without
> > reaching over 1.0 or -1.0.
> >
> > I guess I could convolve the kernel with a white noise or MLS (or even
> > a log sweep) that would be at first normalized to 1.0 and I'd look
> > forward making the result normalized to 1.0 as well, but honnestly I
> > wouldn't spit on an alternative solution.
>
> Mike,
>
> What you want may be what's commonly referred to as "unobtanium".
> That's because only you know what you want / need.
> (I was going to ask earlier what you really meant by "loud" because that's
> not well defined except as a matter of your own perception - psychoacoustics
> and all that).
by loud I meant well over 1.0 and -1.0. my purpose is to make the
resulting signal hold well between those two boundaries without
crossing, provided that the original sounds repects those too.
> I think that's why equalizers have those little slide handles and radios
> have volume controls. There's no good way to "can" the settings in an
> algorithm.
>
> I really don't understand your description of how you arrive at the filter.
> "performing measurements"
> "cross correlations" <<<< this one puzzles me a bit
> "etc."
> I don't know what a tool being general purpose has to do with anything we're
> discussing.
OK, but I don't wanna get too deep in the details. I obtained the
filter mainly by playing a signal (a log sweep, but it could have been
a MLS or any other signal trhat's well represented in the frequency
range i'm interested in) and recording it, then cross correlating the
two signals (basically, because i did much more than that and also
compensated the bias induced by the non linearity of the orignal
signal's magnitude in the frequency domain), and also "inverting it" so
it can be used as a deconvolution kernel, but I really don't wanna get
in those details.
> "original gain" referring to what? Presumably you have signal that has a
> level or levels but I don't understand "gain" in this context.
Well, idk, actually, from the start I don't think I could even have
quantified the gain really, since the recorded signal of the signal
played by the speaker doesn't reflect any gain.
> If you convolve the kernel (of the filter) with white noise then you'll
> pretty much get a spectrum out that is indicative of the filter response
> which you already know or can know from the filter coefficients.
> If you use a sweep (if I understand you there and taking a leap) you get the
> same thing.
> Now ... you say you want to "normalize the result" (at the output) using a
> "normalized" input.
> OK.
> So, now you're right back to saying this:
> "I want a filter that has unity gain at some frequencies"
> So, you must know what those frequencies are - or similarly know what the
> filter spectral shaping countour is - which suggests that normalization to
> unity only happens at one or a few points.
I'm not sure I got that one. I'm starting to think that there's no
automated solution to that and that i'd just have to try changing my
kernel's gain until I obtain satisfaction with the result's amplitude.
> - If you know what those frequencies are, or what the countour is, then you
> have the specifications for a filter design. (More on this below**).
> Problem solved.
>
> - If you don't know what those frequencies are then you're stuck unless you
> resort to an adaptive filter method which will probably emphasize signals of
> longer duration and deemphasize noise. There are too many approaches and
> structures to mention here and now.
> Anyway, in this situation you end up with a set of filter coefficients and
> have the same situation as above.
> Gain remains subjective though... although line cancellers have to have
> exact gain to do their job and line enhancers operate on the same
> principles. But, is that "exact gain" the gain you want?
Idk if it's cuz i'm tired, but i'm having a though time trying to
understand it all. However, I'm starting to agree with you, I think
that my whole gain thing that I thought at the beginning of this thread
could be treated objectively is really something subjective, although
the result can be verified, it all depends on the type of signal i
convolve it with.
> **If you have a known countour (as might be from an equalizer) then there
> are filter design programs that will design any frequency shape you like.
> Not just stopbands of zero and passbands of 1.0. Or, you might use the
> Parks McClellan program and just specify lots of bands with their own gains.
> Gain remains subjective though...
>
> Maybe a bit more about the real application?
I described shortly above what I did to obtain my filter, the real
application of this is to obtain a real-time sound convolver
"compensating" (understand deconvolving) the frequency response of a
set of speakers (as measured by a calibrated microphone).
The reason for this topic is that, since it'll be outputting integers,
I have to make sure that a signal normalized to +/-1.0 in the input
will otuput as a signal normalized to +/-1.0 or something close.
however, since it's supposed to be real time, you can't just normalize
the output, since if you normalize a buffer with a certain value,
another buffer with higher peaks will be normalized with a certain
value, and it wouldn't sound right (a buffer would suddenyl sound lower
than another). Although after awhile, provided that the value for the
highest peak ever encountered is kept, i don't like this solution too
much, since it might take some time till the max value of the
normalization is reached.
So I guessed that maybe convolving it with a white noise could give a
representative idea of the output's amplitude, and what to do to keep
it close to the input's, although at the peak frequencies in the
kernel, if only those peak frequencies are in the input signal, the
output signal might go over +/-1.0. So the next idea is too convolve
with a sweep : thus, let's say for example the peak frequency in my
kernel is 300 Hz, in the output, the sweep will have the highest
amplitude at the part it reaches 300 Hz, thus, normalizing according to
the max amplitude reachable with the kernel's peak woudl garantee not
getting over +/-1.0 in the output signal but potential close.
I guess this isn't too bad, although it might make it sound most of the
time less "loud" than the original signal, I also thought that this
could be achived by making the frequency peak in the kernel's magnitude
equal the value all magnitudes in the frequency would have if it was a
delta function of the same length, although i'm not sure, plus idk how
to calculate that value without actually creating a delta function
zero-padded to the lengtrh of the signal i'm trying to normalize and
then FFT it and turn it to polar form.
So maybe the best is to try messing with the kernel until the user/me
decides it sounds loud enough/not too loud, but I wanna hear your
opinion :)