discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] root_raised_cosine principle


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] root_raised_cosine principle
Date: Wed, 3 Sep 2014 09:47:58 -0400

On Mon, Sep 1, 2014 at 11:50 AM, Martin Braun <address@hidden> wrote:
Please stick to the list.

On 09/01/2014 05:35 PM, adream wrote:
> Thanks for your reply
> May be I should make my question more specifically,
>
> den = -32 * M_PI * alpha * alpha * xindx/spb;
>
> I can't understand well why there is "-32"

That I don't know. Of course, it's just a gain change, so it won't
affect the spectral shape.
Perhaps Tom can weigh in here.

M

I looked at that, and I'm not sure where that 32 came from. This code is very old, probably back from the late 90's even. I probably would have written that a lot differently than the code that's in there, but I will say that this code does at least build an RRC filter. Though I'd be curious if you could point to the results being (significantly) different given what you think the filter coefficients given the same parameters should be.

Tom

 
>
> thank you
>
>
> 2014-09-01 23:18 GMT+08:00 Martin Braun <address@hidden
> <mailto:address@hidden>>:
>
>     On 09/01/2014 05:01 PM, adream wrote:
>     > Hi,
>     >    I get the source code of root_raised_cosine function in
>     gr_firdes.cc,
>     > but I can't understand why it writes in that way, is there any
>     paper can
>     > give me more details about the principle of root_raised_cosine
>
>     Any standard textbook on digital communications will explain this. You
>     might want to look out for keywords such as pulse shaping and Nyquist
>     criterion. Have a look at the wiki page for recommended reading.
>
>     M
>
>     > Thank you
>     >
>     > this is the source code of root_raised_cosine
>     > vector<float> gr_firdes::root_raised_cosine (double gain,
>     >                    double sampling_freq,
>     >                    double symbol_rate,
>     >                    double alpha,
>     >                    int ntaps)
>     > {
>     >   ntaps |= 1;    // ensure that ntaps is odd
>     >
>     >   double spb = sampling_freq/symbol_rate; // samples per bit/symbol
>     >   vector<float> taps(ntaps);
>     >   double scale = 0;
>     >   for(int i=0;i<ntaps;i++)
>     >     {
>     >       double x1,x2,x3,num,den;
>     >       double xindx = i - ntaps/2;
>     >       x1 = M_PI * xindx/spb;
>     >       x2 = 4 * alpha * xindx / spb;
>     >       x3 = x2*x2 - 1;
>     >       if( fabs(x3) >= 0.000001 )  // Avoid Rounding errors...
>     >     {
>     >       if( i != ntaps/2 )
>     >         num = cos((1+alpha)*x1) +
>     sin((1-alpha)*x1)/(4*alpha*xindx/spb);
>     >       else
>     >         num = cos((1+alpha)*x1) + (1-alpha) * M_PI / (4*alpha);
>     >       den = x3 * M_PI;
>     >     }
>     >       else
>     >     {
>     >       if(alpha==1)
>     >         {
>     >           taps[i] = -1;
>     >           continue;
>     >         }
>     >       x3 = (1-alpha)*x1;
>     >       x2 = (1+alpha)*x1;
>     >       num = (sin(x2)*(1+alpha)*M_PI
>     >          - cos(x3)*((1-alpha)*M_PI*spb)/(4*alpha*xindx)
>     >          + sin(x3)*spb*spb/(4*alpha*xindx*xindx));
>     >       den = -32 * M_PI * alpha * alpha * xindx/spb;
>     >     }
>     >       taps[i] = 4 * alpha * num / den;
>     >       scale += taps[i];
>     >     }
>     >
>     >   for(int i=0;i<ntaps;i++)
>     >     taps[i] = taps[i] * gain / scale;
>     >
>     >   return taps;
>     > }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]