# About ADC FFT

**URL:** <https://discuss.pynq.io/t/about-adc-fft/6631>\
**Category:** Support\
**Created:** [February 10, 2024, 8:04am UTC](https://discuss.pynq.io/t/about-adc-fft/6631 "2024-02-10T08:04:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![reung](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@reung](https://discuss.pynq.io/u/reung)\
**Post date:** [February 10, 2024, 8:04am UTC](https://discuss.pynq.io/t/about-adc-fft/6631/1 "2024-02-10T08:04:35Z")

</div>

pynq-z2, vivado 2022.2

“I connected the ADC(pmod adc) and FFT IP as shown in the picture below, but I’m having trouble receiving and reading FFT data through DMA in Jupyter Notebook. data\_recv.wait() is not finishing.”

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/6/6ea5b941170eaf037276a4a185d1ccbe13749ed4.png)

Jupyter code  
from pynq import Overlay  
from math import log  
ol = Overlay(‘FFT\_0120.bit’)

ol?

data\_dma=ol.data\_dma  
config\_dma=ol.config\_dma  
data\_recv=data\_dma.recvchannel  
conf\_send=config\_dma.sendchannel

import numpy as np  
import matplotlib.pyplot as plt  
import random  
from pynq import allocate  
import time

SAMPLES = 1024  
output\_buffer=allocate(SAMPLES, np.csingle)

data\_recv.transfer(output\_buffer)  
data\_recv.wait()

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [February 12, 2024, 10:20am UTC](https://discuss.pynq.io/t/about-adc-fft/6631/2 "2024-02-12T10:20:51Z")

</div>

Hi @reung,

Is the FFT IP generating the TLAST signal properly? If not, you will need to add logic to do this.  
There are a number of post in the forums with very similar issues, in relation to the TLAST signal.

Mario

---

<div class="post-metadata">

**Author:** ![reung](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@reung](https://discuss.pynq.io/u/reung)\
**Post date:** [February 12, 2024, 1:09pm UTC](https://discuss.pynq.io/t/about-adc-fft/6631/3 "2024-02-12T13:09:05Z")

</div>

thanks you!  
I checked and found that tlast was not activated.  
But I have one more question.  
in picture that i attached this reply, i connnect adc(Read\_ADC\_Top)-\>fifo generator\_0-\>xfft\_0-\>data\_dma!  
i can read fft data from dma using Jupyter notebook… however i think the value is wrong.  
what did i do wrong…?

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/d/d30c36fc4d06f3cffea1b3776d0ae0e26b8f3ac3.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/8/8ca82a2b162a30e39faf4b27a44e57346e3ce9a3.png)

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [February 12, 2024, 5:07pm UTC](https://discuss.pynq.io/t/about-adc-fft/6631/4 "2024-02-12T17:07:23Z")

</div>

Hi @reung,

The samples are either signed or unsigned integers, so your buffer allocation should take this into consideration.

Mario

---

<div class="post-metadata">

**Author:** ![reung](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@reung](https://discuss.pynq.io/u/reung)\
**Post date:** [February 13, 2024, 4:11am UTC](https://discuss.pynq.io/t/about-adc-fft/6631/5 "2024-02-13T04:11:49Z")

</div>

hi @marioruiz ,  
but i use np.csingle when i allocate buffer.  
i think np.csingle is data type for complex that is positive or negative.  
i have to change this data type?
