Matlab Hamming Window to Vhdl 8-bit

381 views Asked by At

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?

1

There are 1 answers

0
Russell On BEST ANSWER

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);