Forum: GNU Radio Retrieving audio after FFT and IFFT

A8e87197bc45cc15bf50b5089c1486a4?d=identicon&s=25 Guilherme Ritter (guiritter)
on 2013-10-17 00:02
(Received via mailing list)
Hi everyone.
I'm trying to pass an audio file through FFT and IFFT, and the resulting
audio is being distorted. I searched about it and I only found this
link:
http://lists.gnu.org/archive/html/discuss-gnuradio...
I did as suggested and divided the signal by the FFT size after the FFT
but it didn't fixed the problem, although it did changed it a bit. I
tried several combinations, such as switching the Forward/Reverse
settings, dividing in other places and using several power-of-two
values.
I have tested the flowgraph part by part, and it works normally as far
as the conversions to and from complex. I've attached the flowgraph for
further reference. The part with unpacking is related the rest of the
flowgraph, which is not relevant here.
Thanks in advance.
A8e87197bc45cc15bf50b5089c1486a4?d=identicon&s=25 Guilherme Ritter (guiritter)
on 2013-10-17 00:03
(Received via mailing list)
Attachment: fft_test.grc (20 KB)
Sorry, forgot the attachment.
Ad80d352eb445a3d7dccd5a779db0e43?d=identicon&s=25 Martin Braun (CEL) (Guest)
on 2013-10-17 15:23
(Received via mailing list)
On Wed, Oct 16, 2013 at 07:01:31PM -0300, Gui Ritter wrote:
> Sorry, forgot the attachment.

GR 3.7 won't open this. Can you pastebin a screenshot?

MB

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association
A8e87197bc45cc15bf50b5089c1486a4?d=identicon&s=25 Guilherme Ritter (guiritter)
on 2013-10-17 16:14
(Received via mailing list)
I'm new to Pastebin, and I couldn't find an option to upload images, so
I used ImageShack instead.
http://img844.imageshack.us/img844/5910/s2i3.png
Ad80d352eb445a3d7dccd5a779db0e43?d=identicon&s=25 Martin Braun (CEL) (Guest)
on 2013-10-17 16:33
(Received via mailing list)
On Thu, Oct 17, 2013 at 11:13:14AM -0300, Gui Ritter wrote:
> I'm new to Pastebin, and I couldn't find an option to upload images, so I used
> ImageShack instead.

That's fine :)

Have you tried a boxcar window?

MB

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association
0817fa933c74eec9b3fcf3a04e16f418?d=identicon&s=25 Sylvain Munaut (Guest)
on 2013-10-17 16:44
(Received via mailing list)
> http://img844.imageshack.us/img844/5910/s2i3.png

I'm not convinced by the way you handle the complex part of the FFT
result ...

You can't just drop it, it's needed for the reconstruction ...


Cheers,

    Sylvain
Ad80d352eb445a3d7dccd5a779db0e43?d=identicon&s=25 Martin Braun (CEL) (Guest)
on 2013-10-17 16:53
(Received via mailing list)
On Thu, Oct 17, 2013 at 04:44:00PM +0200, Sylvain Munaut wrote:
> > http://img844.imageshack.us/img844/5910/s2i3.png
>
> I'm not convinced by the way you handle the complex part of the FFT result ...
>
> You can't just drop it, it's needed for the reconstruction ...

You're right, but in this case the input was already real and the
"channel" doesn't modify the phase. So it's OK--the 'correct' thing
would be to do a real FFT.

See:
http://imgur.com/z733PGU

Works fine. If you want do to an ifft(fft(x)), you can't have windows
(feel free to do OS jokes here).

MB

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association
558c40b97bd1af8d912424757714bda9?d=identicon&s=25 Marcus D. Leech (Guest)
on 2013-10-17 17:01
(Received via mailing list)
On 10/17/2013 10:52 AM, Martin Braun (CEL) wrote:
> http://imgur.com/z733PGU
>
> Works fine. If you want do to an ifft(fft(x)), you can't have windows
> (feel free to do OS jokes here).
>
> MB
>
Add "joke" windows to filter blocks:

    o Vista
    o XP
    o 95
    o 3.11
    o Blue-window-of-death

:)



--
Marcus Leech
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org
0817fa933c74eec9b3fcf3a04e16f418?d=identicon&s=25 Sylvain Munaut (Guest)
on 2013-10-17 17:18
(Received via mailing list)
Hi,

> You're right, but in this case the input was already real and the
> "channel" doesn't modify the phase. So it's OK--the 'correct' thing
> would be to do a real FFT.

Huh ?

To make sure I actually ran a quick python test before posting :

In [13]: ifft([x.real for x in fft([1,2,3,4])])
Out[13]: array([ 1.+0.j,  3.+0.j,  3.+0.j,  3.+0.j])

As you can see the output of the ifft ( [1,3,3,3] isn't the same as
the fft input [1,2,3,4] ) ...

Cheers,

    Sylvain
Ad80d352eb445a3d7dccd5a779db0e43?d=identicon&s=25 Martin Braun (CEL) (Guest)
on 2013-10-17 17:36
(Received via mailing list)
On Thu, Oct 17, 2013 at 05:17:45PM +0200, Sylvain Munaut wrote:
> Hi,
>
> > You're right, but in this case the input was already real and the
> > "channel" doesn't modify the phase. So it's OK--the 'correct' thing
> > would be to do a real FFT.
>
> Huh ?

Erm, yep :) My apology.
I was assuming you meant the complex part at the end.

MB

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.