discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Resample block for audio signal


From: Andy Walls
Subject: Re: [Discuss-gnuradio] Resample block for audio signal
Date: Sun, 13 Mar 2016 16:28:08 -0400

On Sun, 2016-03-13 at 20:10 +0000, Murray Thomson wrote:
> Hi Andy,
> 
> 
> Thanks a lot, I wasn't expecting so much help. I will read the
> flowgraph and I will try to understand it. 

The magic happens like this:
1. convert the (dual sided spectrum) real audio signal into a (single
sided spectrum) complex audio signal.  (Hilbert block)

2. Pick off the audio amplitude. (Complex to magnitude block)

3. Get the instantaneous frequency by taking the derivative of the
instantaneous phase (quadrature demodulator block)

4. Make a new complex audio signal by using the instantaneous frequency
multiplied by the transposition ratio as part of the argument to sin()
and cos(). (frequency modulator block)

5. ***Missing*** Filter the negative side of the complex spectrum to get
rid of aliases that will fold back in when we convert back to real
audio.  (***Missing*** IIR filter block)

6. Convert the complex audio signal back to real (dual sided spectrum)
audio signal. (complex to float block) 


> I've added an extra sine with double the frequency to simulate the
> first harmonic and when I transpose it I find lots of frequencies. Is
> this expected?

Well yes, now that I see the problem.  There needs to be a (pretty
sharp) filter in between the frequency modulator block and the complex
to float block, to knock out the negative side of the complex spectrum.
You picked a case that creates strong aliases (overlapping harmonics),
so they are noticeable when folding over into the spectrum when going
from complex to real audio.

I just tested with voice, and it sounded funny, but fine. :P

> 
> I will try to find a solution for it once I understand more how it
> works. Thank you so much, I hope you've enjoyed with it :)

Yeah. :)

Regards,
Andy

> 
> Cheers,
> 
> Murray
> 
> 
> On 13 March 2016 at 19:36, Andy Walls <address@hidden>
> wrote:
>         On Sun, 2016-03-13 at 12:00 -0400,
>         address@hidden
>         wrote:
>         > Message: 10
>         > Date: Sun, 13 Mar 2016 12:29:07 +0000
>         > From: Murray Thomson
>         
>         Hi Murray,
>         
>         >
>         > Hi,
>         >
>         > This is probably an easy one but I'm stuck and i could do
>         with some help.
>         > My goal is to get a musical note from the microphone and
>         shift its
>         > frequency to transform the note to a different scale. For
>         this to happen, I
>         > need to multiply all the frequencies for e.g. 1.5.
>         >
>         > I can achieve an octave of the signal multiplying it by
>         itself (doubling
>         > the frequencies). I thought I could do this resampling the
>         signal but now
>         > I'm not too sure. Do I need to use an FFT block for this?
>         >
>         > I would appreciate if someone can suggest the best way to go
>         or point me in
>         > the right direction.
>         
>         Since I was recording my daughter's violin audition video
>         today, I was
>         in the mood to play around with this one.
>         
>         Try the attached *grc file.  Note that you need headphones, or
>         just keep
>         the speakers away from the microphone, or the feedback will
>         ruin
>         everything.
>         
>         Run the flowgraph and select "Up 5th" from the "Transpose" GUI
>         widget to
>         multiply by 1.5.
>         
>         Double check my variables for A3, B3, C4, D4, etc. and the QT
>         GUI
>         chooser widget to make sure I got all the ratios right.
>         
>         > Thanks,
>         > Murray
>         
>         Regards,
>         Andy
> 
> 





reply via email to

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