Hi, Nitin,

I think you have two questions.  One about bit width management and one about 
accumulating the FFT output.

For the bit width question, the first thing I recommend is to turn on the 
Simulink option to show the signal data types.  Then when you do an “Update 
diagram” the data types of each signal will be displayed.  Some blocks will 
just output the sensible output type (bit width/binary point, e.g. "Fix18_17") 
given the input types, but many blocks let you specify the output bit width and 
binary.  Blocks of this type usually have options to specify what to do when 
bits at the high end are “lost”/“dropped” (aka overflow) and what to do when 
bits al the low end are lost/dropped (aka quantization).  The options for 
overflow are “wrap” (i.e. just blindly drop the overflow bits) or “saturate” 
(i.e. clamp at max/min value).  The options for quantization are “truncate” 
(i.e. just blindly drop the extra bits at the low end) or one of several 
different rounding modes.  Wrap and truncate are “free” because they don’t 
require any extra logic, whereas saturation and rounding do require extra 
logic.  You can check out the distinction between the “reinterpret” block and 
the “cast” block for more insights.

As for accumulating FFT output, Martin is right.  If you accumulate the complex 
voltages of the FFT you will effectively be reducing the bandwidth of each FFT 
channel.  If you add two consecutive N channel spectra together 
channel-by-channel then you will have essentially computed the even channels of 
a 2N channel FFT.

Hope this helps,
Dave

> On Jun 1, 2026, at 08:15, Nitin Purohit <[email protected]> wrote:
> 
> Dear all,
> I have a question regarding obtaining complex outputs from the wideband 
> spectrometer.
> 
> While going through the spectrometer design in detail, I noticed that the 
> power block appears to compute the magnitude-squared of the complex FFT 
> output by squaring the real and imaginary components and then summing them.
> 
> <Screenshot from 2026-06-01 18-38-30.png>
> In the complex spectrometer design, the FFT output consists of:
> 
> First 24 bits: Real component (MSB first)
> Next 24 bits: Imaginary component (LSB side)
> Since each component is multiplied by itself, the resulting products are 48 
> bits wide. After the summation, the output becomes approximately 49 bits (48 
> + 1 carry bit).
> 
> My difficulty is understanding how this output relates to the subsequent 
> simple_bram_vacc block, which is configured with:
> 
> BitWidth = 64
> Binary Point = 34
> How are these parameters derived from the incoming data stream?
> 
> A similar question arises in the real spectrometer design. There, the real 
> and imaginary components appear to be 18 bits each, resulting in a power 
> computation width of approximately 36 + 1 bits. However, the simple_bram_vacc 
> parameters appear to remain unchanged. I am therefore trying to understand 
> the rationale behind the BitWidth and Binary Point settings of the 
> accumulator.
> 
> <Screenshot from 2026-06-01 19-01-33.png>
> From examining the simple_bram_vacc (figure above the para) and delay_bram 
> (figure above the para) block diagrams, my current understanding is that:
> 
> A pulse is generated every vector_length samples (512 in this case).
> During the accumulation period, the delay BRAM stores data at incrementing 
> addresses.
> The accumulation continues until the count reaches approximately (DelayLen − 
> bram_latency − 1).
> However, I am unsure whether this interpretation is correct.
> 
> <Screenshot from 2026-06-01 19-11-38.png>
> My current goal is to modify the spectrometer to preserve and output the 
> complex FFT values instead of computing power. If I bypass the power 
> calculation and directly pass the complex FFT output into the accumulation 
> stage:
> 
> How would simple_bram_vacc store the incoming complex values?
> Would separate accumulators be required for the real and imaginary streams?
> Is there an existing CASPER block or example design that demonstrates 
> accumulation of complex spectra rather than power spectra?
> I would greatly appreciate any explanation or pointers to relevant 
> documentation regarding this.
> 
> Hoping for a response soon,
> 
> Thank you,
> Sincerely,
> Nitin
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "[email protected]" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion visit 
> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/0b14ee1f-3011-4def-a85d-8565937b855en%40lists.berkeley.edu
>  
> <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/0b14ee1f-3011-4def-a85d-8565937b855en%40lists.berkeley.edu?utm_medium=email&utm_source=footer>.
> <Screenshot from 2026-06-01 19-01-33.png><Screenshot from 2026-06-01 
> 18-38-30.png><Screenshot from 2026-06-01 19-11-38.png>

-- 
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/2B541439-A42B-4593-A73E-62F91F80F7B1%40berkeley.edu.

Reply via email to