0

I am going to use 128 point Hamming Window to be implemented in Vhdl. In Matlab, I obtained the values of the Hamming Window as:

h = hamming(128);

But, what Matlab gave me is varying values in the range 0 and 1. How can I convert these values into 8-bit?

Qiu
  • 5,651
  • 10
  • 49
  • 56
user893970
  • 889
  • 6
  • 17
  • 28

1 Answers1

0

If you multiply all of the results that matlab gives you by 2^8 and round down you will have successfully converted all of the numbers to 8-bit.

So for example:

bit_depth = 8;
h=hamming(128);
h_binary = floor(h*2^bit_depth);
Russell
  • 3,384
  • 4
  • 31
  • 45