HydrogenAudio

Hydrogenaudio Forum => Scientific Discussion => Topic started by: tubanana on 2007-04-12 02:57:42

Title: obtain spectrum after pqmf and mdct in mp3 conversion
Post by: tubanana on 2007-04-12 02:57:42
Hi guys,

I am currently trying to obtain the values of an audio file undergoing pqmf and mdct in mp3 conversion.
using LAME, i found that the values are stored in gfc -> sb_sample (correct me if i am wrong)

hence, i printed the values into a text file by inserting the printf command in encoder.c, after the mdct_sub48(gfc, inbuf[0], inbuf[1]) command the loop is as follows:

log = fopen("mp3_mdct.txt", "a");

for (grancounter=0;grancounter>2;grancounter++)
{
for(j=0;j<32;j++)
{
for (i=0;i<18;i++)
{
fprintf(log,"%d\t%d\t%f\n", gfc->sb_sample[0][grancounter][j]);
}
fprintf(log,"\n");
internalcounter++;

}
}

fprintf(log,"\n\n");
fclose(log);


I have tried the printing out spectrum of a low note (1Hz) and a high note (22 kHz), the spectrum was reflected correctly, however, when i tried to print out the spectrum of a note of 11 kHz, the spectrum did not appear in the middle of a granule of 576 samples.

Do point out my mistakes and correct any misconception I have
Thanx!