--- Quote Start ---
The most simple way is to store them in FPGA internal RAM. Once having the data there, you can transfer them to the PC with a Quartus tool, the In-System-Memory Editor, if the RAM has been generated with a respective interface.
To make the codec sample the audio stream, you have to modify the setup from the demonstration projects, and decode the serial data stream into parallel data. As far as I'm aware of, the demonstration projects don't yet use the ADC function of the codec.But it's basically easy, similar to converting parallel to serial data as in the SD-card audio application, but the other way around.
--- Quote End ---
Hi Thank you for your reply. Actually i am trying to work out my algorithm on the FPGA and analyse the audio data that i have sampled with that algorithm. Not transfer to MATLAB, sorry that i conveyed my message wrongly in previous post.
But I have couples of question regarding to the coding to sample the audio signal with WM8731L codec.
I have gone through the WM8731L datasheet and noticed that the ADCDAT is the pin that output the digital audio data signal. But may i know
1) how can i configure the code to sample the audio data at 8000 Hz with 16 bit data?
2) how can i store them to FPGA internal ram? Is it something like below?
reg [23:0]audio_Data;
reg index = 1;
input ADCCAT;
always @(posedge CLOCK ) begin
if (index<8001) begin
audio_Data[index] = ADCCAT;
index = index + 1;
if (index==8001) begin
index=1;
end
end
end
Then how can i link this to the In-System-Memory Editor? Do i need that if i wanna retrieve the data?
3) How can i work out FFT on the audio that i have retrieved? I have to write a FFT function? or Does quartus II already as built in FFT block?
I am very sory that i asked many stupid question. But i really wish to learn how can i analyze my audio signal that i captured from mic by writing my algorithm to FPGA.
Actually, at the same time, I have completed my simulation with MATLAB's Simulink. Now wish to work out the same thing on Altera DE2 FPGA.
Many thanks again.