Forum Discussion
Altera_Forum
Honored Contributor
17 years agoHi,
I see your set-up is complicated and I suggest you break it up. I had a quick look at your data scaling below: for (t=0.0;t<0.1;t+=0.0001) { temp=sin(2*pi*500*t)+sin(2*pi*127*t); //Max/Min = 2/-2 data[i++]=(temp+2)*16383; //Scale the result so that it's between 0-65535 } You are generating dc since your fft , I assume, uses 2's complement you must scale to + 32767 for 16 bits e.g. data[i++]= round(temp*32767/max(abs(temp))) note also that your frequency is a function of your sampling rate and I am not sure you are generating it at the stated frequency. you might better remove nios from the scene. Pass one sinusoid from a LUT into fft then use signaltap to capture a frame. convert data to text and read in matlab. Kaz