Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I am trying to come to grips with the DFB, in this case configured as a high pass filter (or band pass) such that there should be no DC component in the output samples.
I am feeding the DFB with 12-bit unsigned samples from an ADC (via DMA using the alignment features of the DFB). I am using the 'Filter_Read16()' API function to read the result from the holding registers. The output of that function are 'uint16' values.
However I would have thought that a filter that removes the DC component form a signal would then only have the AC component remaining. To me this means that the value should be signed as the filter output can be positive or negative.
Q1) Is that correct?
I see that the documentation states that the return value is "16-bit filter output value represented inb 2's complement".
I suppose I could experiment with this myself but I thought it would be better to get a definitive answer form those 'in the know"!
Q2) Does that mean I can safely save the return value directly as a signed 16-bit integer (in which case the top 4 bits should always be the same; either all 0's for a positive value or all 1's for a negative value)?
Q2a) If not then what format will the number (and in particular the negative numbers) take?
Not easy to write a datasheet and staying simple. Providing to know the word "two's complement" makes the elaborate more valuable than using the term "signed int". And providing a signed result as an unsigned function return is ... well, ... nasty
I would suggest you to create a support case to point Cypress to this ambiguity.