Retrieving audio after FFT and IFFT

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/2012-10/msg00111.html
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.

Sorry, forgot the attachment.

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

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 B.
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

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 :slight_smile:

Have you tried a boxcar window?

MB


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

Dipl.-Ing. Martin B.
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

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

On 10/17/2013 10:52 AM, Martin B. (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

:slight_smile:


Marcus L.
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org

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

On Thu, Oct 17, 2013 at 04:44:00PM +0200, Sylvain M. 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 B.
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

On Thu, Oct 17, 2013 at 05:17:45PM +0200, Sylvain M. 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 :slight_smile: 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 B.
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