Support and General Use > Hardware
Sansa Clip Zip: EQ-settings different for each channel?
arom:
--- Quote from: saratoga on September 16, 2017, 08:30:38 PM ---I don't think it is realistic for you to change the EQ without first understanding c syntax.
Edit: To answer your question, the square brackets are used to access arrays, so coefs[0] is the first element of the array coefs. The values are set in the _coefs functions just above filter_process. If you want to learn about this, a general reference to c programming is probably a good place to start.
--- End quote ---
I didn't see an array declaration in the way they show in online tutorials, that's what had me confused. I expected to see coefs[5] somewhere. Are my assumptions correct in that:
coefs[0] is the filter_shelf_coefs() function
coefs[1] is filter_bishelf_coefs
coefs[2] is filter_pk_coefs
coefs[3] is filter_ls_coefs
coefs[4] is filter_hs_coefs ?
Thank you for helping me.
saratoga:
--- Quote from: arom on September 16, 2017, 11:36:43 PM ---Are my assumptions correct in that:
coefs[0] is the filter_shelf_coefs() function
coefs[1] is filter_bishelf_coefs
coefs[2] is filter_pk_coefs
coefs[3] is filter_ls_coefs
coefs[4] is filter_hs_coefs ?
--- End quote ---
Each set of coefficients represents one IIR filter, and each of those functions can calculate a different type of filter (for example, bishelf_coefs calculates the coefficients for a bishelf filter). filter_process is called once for each EQ filter the user enables.
Take a look at the comments in the file. They explain the meaning of those coefficients, how they are calculated, and provide a reference that describes what those functions are doing in more detail.
arom:
--- Quote from: saratoga on September 17, 2017, 01:27:45 AM ---
--- Quote from: arom on September 16, 2017, 11:36:43 PM ---Are my assumptions correct in that:
coefs[0] is the filter_shelf_coefs() function
coefs[1] is filter_bishelf_coefs
coefs[2] is filter_pk_coefs
coefs[3] is filter_ls_coefs
coefs[4] is filter_hs_coefs ?
--- End quote ---
Each set of coefficients represents one IIR filter, and each of those functions can calculate a different type of filter (for example, bishelf_coefs calculates the coefficients for a bishelf filter). filter_process is called once for each EQ filter the user enables.
--- End quote ---
So, there is an array of 5 elements called coef[] per each EQ filter? 12 EQ bands x 5 = 60 elements?
Other somewhat related questions:
in void filter_process(struct dsp_filter *f, int32_t * const buf[], int count, unsigned int channels), is "count" the number of enabled EQ filters?
I thought I'd figured out a way to make the EQ apply to only one channel, by changing the "0" in "for (unsigned int c = 0; c < channels; c++)" to 1, assuming the number of channels is 2, it would no longer apply the EQ to the second channel due to c<channels no longer being true. I did that, compiled it and tried it on my Clip+, but it still applies the EQ to both channels; I tried equaling c to several other numbers up to 100, same result. I tried doing the same thing for "for (int i = 0; i < count; i++)" also, same result.
How many channels are there? What value of "c" is needed so that "c<channels" is no longer true?
saratoga:
--- Quote from: arom on September 17, 2017, 01:16:05 PM ---
--- Quote from: saratoga on September 17, 2017, 01:27:45 AM ---
--- Quote from: arom on September 16, 2017, 11:36:43 PM ---Are my assumptions correct in that:
coefs[0] is the filter_shelf_coefs() function
coefs[1] is filter_bishelf_coefs
coefs[2] is filter_pk_coefs
coefs[3] is filter_ls_coefs
coefs[4] is filter_hs_coefs ?
--- End quote ---
Each set of coefficients represents one IIR filter, and each of those functions can calculate a different type of filter (for example, bishelf_coefs calculates the coefficients for a bishelf filter). filter_process is called once for each EQ filter the user enables.
--- End quote ---
So, there is an array of 5 elements called coef[] per each EQ filter? 12 EQ bands x 5 = 60 elements?
--- End quote ---
The maximum number of EQ bands is 10. But yes, each one has 5 elements, so the most you can have is 50.
--- Quote from: arom on September 17, 2017, 01:16:05 PM ---in void filter_process(struct dsp_filter *f, int32_t * const buf[], int count, unsigned int channels), is "count" the number of enabled EQ filters?
--- End quote ---
Count is the number of samples to process. filter_process is called for each band, so it doesn't actually need to know how many bands there are.
--- Quote from: arom on September 17, 2017, 01:16:05 PM ---I thought I'd figured out a way to make the EQ apply to only one channel, by changing the "0" in "for (unsigned int c = 0; c < channels; c++)" to 1, assuming the number of channels is 2, it would no longer apply the EQ to the second channel due to c<channels no longer being true. I did that, compiled it and tried it on my Clip+, but it still applies the EQ to both channels; I tried equaling c to several other numbers up to 100, same result. I tried doing the same thing for "for (int i = 0; i < count; i++)" also, same result.
--- End quote ---
The c version of that function is not used on ARM devices like your clip, rather the ARM version I linked above is called instead for performance reasons. Compile the simulator version on your PC if you want to test the c version of that code, or just change the value of channels when filter_process is called.
arom:
I counted the Bass/Treble tone controls as additional bands.
In the ARM assembly file, if r3=channels, how would I represent a single channel? I see the comment "@ r3 = ch = channels - 1", would it be "r3 - 1" then? Something else?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version