3

I read on section 14.3.8 of the STM32F4 reference manual that you can mask the LFSR output value partially or totally.

At first I thought that it was used to change the pseudo random pattern (representative polynomial function) but I'm not really sure anymore.

What's the real purpose of this mask?

I'm not very familiar with LFSR noise generation so I might have got everything wrong...

Dave Tweed
  • 168,369
  • 17
  • 228
  • 393
Florent
  • 370
  • 3
  • 18

1 Answers1

4

According to section 14.5.1 of that same document the MAMPx[3:0] bits are used to control the amplitude of the generated noise (or triangle) waveform. For noise, they simply mask off (force to zero) the high-order bits of the LFSR output.

It seems pretty clear that the noise/triangle waveform can be used as a "dithering" signal for ADC operations, and that's what they have in mind with this feature.

Dave Tweed
  • 168,369
  • 17
  • 228
  • 393
  • Thanks for you answer! I still don't understand how masking the high order bits changes this amplitude of the noise waveform though... I thought it would only change the frequency response of the noise – Florent Jun 09 '16 at 21:48
  • If you mask off the high-order 8 bits from a 12-bit number, you get values in the range of 0-15 only. If you only mask off 6 bits, you get values in the range of 0-63. Bigger numbers means higher amplitude. The masking actually has no effect on the frequency content -- white noise is white noise regardless of the number of bits of resolution. – Dave Tweed Jun 10 '16 at 05:08
  • Oh yeah sure I'm sorry, I didn't think about it like that – Florent Jun 10 '16 at 07:36