Jump to content

Sergio Lopez

Members
  • Posts

    2
  • Joined

  • Last visited

Sergio Lopez's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Hello, i'm doing some modifications to the Audio DMA Project, i'm using the Zybo Z7-20 with Vitis and Vivado 2023.2 version. In the last topic i had a problem while reading the audio data from the memory which i have solved using pointers with the correct memory direction and the byte lenght of each data. Now, i want to process this data using the FFT algorithm. //FFT Algorithm void fft(Complex data[], int n) { if (n <= 1) return; // Separate even and odd elements Complex even[n/2], odd[n/2]; for (int i = 0; i < n/2; ++i) { even[i] = data[2*i]; odd[i] = data[2*i + 1]; } // Recursive FFT for even and odd parts fft(even, n/2); fft(odd, n/2); // Combine results of even and odd parts for (int k = 0; k < n/2; ++k) { float theta = -2 * PI * k / n; Complex t = {cosf(theta), sinf(theta)}; t.i1 *= odd[k].i1; t.i2 *= odd[k].i2; data[k].i1 = even[k].i1 + t.i1; data[k].i2 = even[k].i2 + t.i2; data[k + n/2].i1 = even[k].i1 - t.i1; data[k + n/2].i2 = even[k].i2 - t.i2; } } The problem i have is that i only can realize the FFT to 1024 samples which i believe it's a low number of samples considering the performance of the board. When i try to put more than this quantity i get nule values in the exit like the memory capacity runs out. I believe that the problem is not the memory capacity if not the data storage in the memory because this board has a 1GB RAM enough for the audio and FFT data. How can i increase the number of samples of the FFT?
  2. Hello, I'm doing some modifications to the Audio DMA Project, i'm using the Zybo Z7-20 with the Vitis and Vivado 2023.2 version. This project storage the audio data received by the codec at 96khz during a period of time with a microphone in the memory using AXI DMA, also you can reproduce the file using some headphones. The point is that i want to read the data that it's storaged, for this purpose i have made the next code: INTPTR adr = (u32) MEM_BASE_ADDR; //Starting address of the data, i get this looking in the function used in the project u32 len = (3 * NR_AUDIO_SAMPLES); //(Time of sec * freq), multiply by 3 because, the data lenght is 24 bits, so it fills 3 memory address (each 1 byte) const u32 cacheline = 3U; //Aumenting the memory address in 3 to match the size of the data get by the audio codec u32 tempadr = adr; //Starting Memory Address u32 tempend = adr + len; //Final Memory Address while (tempadr < tempend){ //Loop in the interval and auments by 3 each iteration int* i = (int*) tempadr; u32 data = *(volatile u32*) i; //Get back the data in the actual memory address using pointer xil_printf("%u\r\n", data); //Write the data in the serial terminal tempadr += cacheline; } I printf the data in the serial terminal and save the data using external applications, i get the correct number of data, but the problem is that the data looks nonsense is oscillates between the min and max value of 24bits. The procedure was to knock the table and recording the sound in the memory of the Zybo Z7 and then storage the data (Look the data graph). In theory, the data should look like a straight graph and a peak corresponding to the knock on the table. And i don't know if the problem is that i'm reading the data wrong or the direction is not correct. Thanks for your responding.🙃
×
×
  • Create New...