
Home  Forums  Rules  Articles  diyAudio Store  Blogs  Gallery  Register  Donations  FAQ  Calendar  Mark Forums Read 
PC Based Computer music servers, crossovers, and equalization 

Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving 

Thread Tools 
18th October 2021, 04:16 PM  #501 
diyAudio Member
Join Date: Jul 2019

Hi Francesco,
try to replace in line 129 Code:
unsigned int bins[spectrum_size+1]; Code:
unsigned int bins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 22, 26, 31, 36, 43, 51, 61, 72, 86, 102, 121, 144, 170, 202, 240}; and compile it again. Note: This is untested. No guarantee. Note2: The Spectrum Size you wished is 32. Kind regards Tobias 
19th October 2021, 10:24 PM  #502 
diyAudio Member
Join Date: Aug 2020
Location: Rome  Italy

Thank you very much, Tobia.
I have tried and it is much better than the previous one. I have 2 questions: 1. How can you calculate the numbers you suggested? So if you change something, I don't need to bother you. 2. How can I exclude any window options? It seems to me that 2 of the 3 options create a lot of noise on all frequencies. Thanks again and greetings, Francesco 
20th October 2021, 06:19 AM  #503 
diyAudio Member
Join Date: Aug 2020
Location: Rome  Italy

Sorry, Tobias.
The first question is: How can you calculate the numbers you suggested? So if I would like to change something, I don't need to bother you. Thanks again and best regards, Francesco 
21st October 2021, 12:19 PM  #504 
diyAudio Member
Join Date: Jul 2019

Hi,
the result of the fftwalgorithm are 256 frequency bins (+1 DC). They are equal distributed. The maximum frequency is sample_rate/2, eg. 22.05kHz for 44.1kHz sample rate. So the first frequency is 22050Hz / 256 ~= 86 Hz The second is 2x the first: 2x 22050Hz / 256 = 172Hz and so on. The numbers represent the indices used for calculation. E.g.: bins = {1, 2, 3, 5, 9} returns values for frequencies: Code:
for(x = bins[m]; x < bins[m+1]; x++) x = 1 .. x < 2 amplitudes summed for f=f(1) = 86Hz m=1: x = 2 .. x < 3 amplitudes summed for f = f(2) = 172Hz m=2: x = 3 .. x < 5 amplitudes summed for f = f(3) = 258Hz and f = f(4) = 345Hz m=3: x = 5 .. x < 9 amplitudes summed for f = f(5) = 431Hz up to f = f(8) = 689Hz I hope I could clarify more than I caused confusion... Kind regards, Tobias 
21st October 2021, 09:25 PM  #505 
diyAudio Member
Join Date: Aug 2020
Location: Rome  Italy

Thanks Tobias,
I will try and inform you about it. Thanks again and greetings, Francesco 
Yesterday, 10:48 AM  #506 
diyAudio Member
Join Date: Aug 2020
Location: Rome  Italy

Hi Tobias, hi everyone,
after numerous and thorough tests I am pretty sure I can say that my opinion is that: 1. The frequency spectrum sent by peppyalsa ends at 44100 and not 22050 (such as try using "logarithmic_frequency 0" and only half of the values sent will be different from 0). 2. The "Window function for FFT" cannot be avoided (such as try using "window 0" and try to listen to a fixed frequency signal such as a 1000Hz sine wave and you can notice many of the values sent will be other than 0). I would be very happy if you could give me your point of view on the items just described. Forgive me if I am too pushy and pressing. Thanks for everything and have a nice weekend, Francesco 
Today, 10:06 AM  #507 
diyAudio Member
Join Date: Jul 2019

Hi Francesco,
thanks for sharing your opinion. 1. The FFT always ends at the half of your sample rate. If the sample rate is 44100Hz, the upper most frequency is 22050Hz. For confirmation you can check it on e.g. on a PeppyPlayer, see attachment. What is your sample rate? 2. You can disable the windowing be setting it to any other number than 1, 2 or 3, as the windowing is only applied if it is set to one of these numbers: Code:
if (window_function == 1) {input_buffer[buffer_index] = input_buffer[buffer_index] * hann[buffer_index];} if (window_function == 2) {input_buffer[buffer_index] = input_buffer[buffer_index] * hamm[buffer_index];} if (window_function == 3) {input_buffer[buffer_index] = input_buffer[buffer_index] * black[buffer_index];} Kind regards Tobias 
Today, 10:37 PM  #508 
diyAudio Member
Join Date: Apr 2015
Location: San Francisco

Francesco, can you share the testing file which you use and the output (screenshot) which you observe? That would help to reproduce the issue (if any).
Thanks in advance! 
Thread Tools  


New To Site?  Need Help? 