[op25-dev] Re: OP25 GRC - Almost but not quite working

rrgsti bobrich at gmail.com
Thu Jun 14 10:06:13 UTC 2012


Ahhhhh...who would have thought a deputy calling in tags could be like music to my ears.

lol

Sounds fantastic.  Great job Clayton and thanks to everyone that has poured so much time and effort into this project and helping neophytes like myself along the way!

Bob

--- In op25-dev at yahoogroups.com, "argilo314" <argilo at ...> wrote:
>
> Strange, something got messed up when I posted the patch to Pastebin.  Try grabbing the patch from here instead: http://argilo.dyndns.org/files/imbe-fixes-new2.patch
> 
> - Clayton
> 
> --- In op25-dev at yahoogroups.com, "rrgsti" <bobrich@> wrote:
> >
> > Hi Clayton,
> > 
> > For some reason the patch against the .cc file won't apply at all...every hunk fails, even though they appear to line up more or less.  The .h patch applies 'with fuzzing'.  Any idea why?  I pulled a fresh copy of revision 301 from svn to try it with.  I'm just running 'patch -p0 < op25.diff'
> > 
> > I tried doing it by hand but the result sounded like glass shattering behind the voices...kind of interesting really.
> > 
> > Thanks again!  I feel like I'm 10 years away from understanding what half of that code does...I'm glad you have it figured out.  :)
> > 
> > Bob
> > 
> > --- In op25-dev at yahoogroups.com, "argilo314" <argilo@> wrote:
> > >
> > > It's fixed!  I've posted a patch with all my fixes here:
> > > 
> > > http://pastebin.com/8Tw0DNyy
> > > 
> > > Audio output is sounding very good now.
> > > 
> > > - Clayton
> > > 
> > > --- In op25-dev at yahoogroups.com, "argilo314" <argilo@> wrote:
> > > >
> > > > I believe I found the source of the remaining warble.  The unvoiced synthesizer seems to be filtering the same noise in each 20ms frame, rather than starting with fresh white noise each time, resulting in a 50 Hz hum.  I'll try fixing it to match the spec over the few days.
> > > > 
> > > > - Clayton
> > > > 
> > > > --- In op25-dev at yahoogroups.com, "argilo314" <argilo@> wrote:
> > > > >
> > > > > I found the correct fix for the phase issue in the fine transition code.  There was pi^2 in a couple places where it should have been 2*pi.  Here's a patch that includes all my fixes so far:
> > > > > 
> > > > > Index: blocks/src/lib/software_imbe_decoder.cc
> > > > > ===================================================================
> > > > > --- blocks/src/lib/software_imbe_decoder.cc	(revision 301)
> > > > > +++ blocks/src/lib/software_imbe_decoder.cc	(working copy)
> > > > > @@ -757,6 +757,7 @@
> > > > >  {
> > > > >     int i,j;
> > > > >  	//initialize
> > > > > +   OldL = 0;
> > > > >     Old = 1; New = 0;
> > > > >     psi1 = 0.0;
> > > > >     for(i=0; i < 58; i++) {
> > > > > @@ -931,7 +932,7 @@
> > > > >  //         if(abs((int)sample) > 32767) {
> > > > >  //            sample = 32767 * (sample < 0) ? -1 : 1; // * sgn(sample)
> > > > >  //         }
> > > > > -         sample /= 16384.0; /* 32768.0 - but audio amplitude is not full range of int16  */
> > > > > +         sample /= 65536.0;
> > > > >           samples->push_back(sample);
> > > > >        }
> > > > >     }
> > > > > @@ -1394,10 +1395,8 @@
> > > > >        if(vee[ell][ New]) {
> > > > >           if ( vee[ell][ Old]) {
> > > > >              if(ell < 8 && fabsf(w0 - Oldw0) < .1 * w0) { // (fine transition)
> > > > > -               const double PI_SQUARED = M_PI * M_PI;
> > > > > -               const double INV_PI_SQUARED = 1.0 / PI_SQUARED;
> > > > >                 Dpl = phi[ell][ New] - phi[ell][ Old] -(Oldw0 + w0) * ell * 80;
> > > > > -               Dwl = .00625 * (Dpl - PI_SQUARED * floorf((Dpl + M_PI) * INV_PI_SQUARED));
> > > > > +               Dwl = .00625 * (Dpl - 2 * M_PI * floorf((Dpl + M_PI) / (2 * M_PI)));
> > > > >                 THa = (Oldw0 * (float)ell + Dwl);
> > > > >                 THb = (w0 - Oldw0) * ell * .003125;
> > > > >                 Mb = .00625 *(MNew - MOld);
> > > > > 
> > > > > --- In op25-dev at yahoogroups.com, "rrgsti" <bobrich@> wrote:
> > > > > >
> > > > > > I admire your tenacity Clayton!
> > > > > > 
> > > > > > The change to software_imbe_decoder does improve audio quality at this end as well.  I added a small amount of logging and noted that the code is going back and forth between the fine and coarse transition operations, so it doesn't seem like something is just 'pegged' at a wrong value.  This is all magic to me, however, so I have no intuition about what is or is not correct.
> > > > > > 
> > > > > > This is running on 11.10 with itpp 4.07 built from source, latest copies of op25 and fairly recent gnuradio and gr-baz.
> > > > > > 
> > > > > > Thanks!
> > > > > > 
> > > > > > --- In op25-dev at yahoogroups.com, "argilo314" <argilo@> wrote:
> > > > > > >
> > > > > > > I've made a bit of progress.  It appears that the phase calculation in  software_imbe_decoder::synth_voiced is not correct in the "fine transition" case, resulting in abrupt phase shifts between the 20ms frames.  I'm not sure yet how to correct it, but by commenting out the "fine transition" case completely so that the "coarse transition" case always runs instead, I've eliminated most of the warble.
> > > > > > > 
> > > > > > > Another problem I noticed is that the audio output is sometimes greater than 1.0, resulting in clipping if connected directly to an audio sink.  I corrected this by changing the "sample /= 16384.0;" line at the end of software_imbe_decoder::decode_audio back to "sample /= 32768.0;".
> > > > > > > 
> > > > > > > - Clayton
> > > > > > > 
> > > > > > > --- In op25-dev at yahoogroups.com, "argilo314" <argilo@> wrote:
> > > > > > > >
> > > > > > > > I'm getting the same issue with the sound: speech is intelligible but with a strong warble that makes it sound like talking through a fan.  I had a quick look at the waveform and spectrum of the output but didn't spot any obvious problems there.  Not knowing IMBE, I couldn't get far with the code.  Any ideas?
> > > > > > > > 
> > > > > > > > - Clayton
> > > > > > > > 
> > > > > > > > --- In op25-dev at yahoogroups.com, "rrgsti" <bobrich@> wrote:
> > > > > > > > >
> > > > > > > > > Basically looking at bit 113 (only) seems to indicate whether or not it's a voice frame of some sort.  The audio still sounds like everyone is talking through a fan, but there are no dropouts, no clicks, no stutters, etc.  
> > > > > > > > > 
> > > > > > > > > I could not find anything resembling a DUID or NAC in the headers.  If anyone has a suggestion to de-warble the audio, I would greatly appreciate it.
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/op25-dev/attachments/20120614/a7c9345c/attachment.html>


More information about the op25-dev mailing list