- #1

nashed

- 58

- 5

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

In summary, the author is trying to build a system that receives coefficients and performs a Fourier approximation, and is stuck at this step as he is not sure how to sample his 23 bit number so he gets the correct shape of the function without distortions.

- #1

nashed

- 58

- 5

Engineering news on Phys.org

- #2

Baluncore

Science Advisor

2023 Award

- 15,162

- 9,017

You need to keep the signal in range on the screen. Can you display more than 8 bit data?

If your output is to be in dB then you might take the log (to the base two) of the 23 bit number.

If your output must be linear you will need to search for the maximum and scale the dataset.

display(i) = 255 * value(i) / maximum.

The process gain of the transform will increase the dynamic range of the output spectrum by the square root of the number of input samples.

- #3

nashed

- 58

- 5

Baluncore said:

You need to keep the signal in range on the screen. Can you display more than 8 bit data?

If your output is to be in dB then you might take the log (to the base two) of the 23 bit number.

If your output must be linear you will need to search for the maximum and scale the dataset.

display(i) = 255 * value(i) / maximum.

The process gain of the transform will increase the dynamic range of the output spectrum by the square root of the number of input samples.

Thanks for the reply! I was going for something similar, thing is my dataset is dynamic which means my maximum will change in real time, I suppose the easy solution is to always output the last 8 bits, am I correct?

- #4

Baluncore

Science Advisor

2023 Award

- 15,162

- 9,017

You could just display the most significant 8 bits but you will be throwing away much of your data.nashed said:I suppose the easy solution is to always output the last 8 bits, am I correct?

If you do not have a fast multiply function then, rather than tracking the maximum, consider doing a 23 bit OR of all the data values into a common register that started out zero. After the accumulate, the first set bit will tell you how many bits to shift the output to show the most useful 8 bits.

- #5

sophiecentaur

Science Advisor

Gold Member

- 29,358

- 7,074

For really drastic bit reduction is could be worth using floating point arithmetic.

Hardly 'without distortions' but what level of distortion would be acceptable?nashed said:so I get the correct shape of the function without distortions.

You could always low pass filter the high res data, which would reduce apparent distortion.

There are so many possibilities but the best one would depend upon your actual requirement and what complexity (and delay) you can accept for the processing.

- #6

marcusl

Science Advisor

Gold Member

- 2,871

- 571

- #7

Baluncore

Science Advisor

2023 Award

- 15,162

- 9,017

This appears to be a Fourier Synthesis exercise, computed in hardware using integers only.nashed said:I'm trying to build a system that receives coefficients and performs a Fourier approximation,

Unless there is some intelligent control of the integer input coefficients, the output amplitude will need to be scaled.

- #8

sophiecentaur

Science Advisor

Gold Member

- 29,358

- 7,074

Raised Cos analysis is what's done for video bit reduction. I think it's chosen for speed and for the subjective qualities of the result (relevant here). There is a load of stuff about MPEG coding and its history (and Jpeg, too). The questions of scaling, blocking and interpolation have all been addressed since digital transmission of sound and vision have been implemented. No need to reinvent a wheel, I think.Baluncore said:This appears to be a Fourier Synthesis exercise, computed in hardware using integers only.

Unless there is some intelligent control of the integer input coefficients, the output amplitude will need to be scaled.

- #9

Baluncore

Science Advisor

2023 Award

- 15,162

- 9,017

I thought that this was an introductory exercise in VHDL. There was no OP mention of fast transform algorithms or data compression.sophiecentaur said:No need to reinvent a wheel, I think.

- #10

sophiecentaur

Science Advisor

Gold Member

- 29,358

- 7,074

I think there is problem here with terminology and definitions in the OP. As usual on PF, the terms were picked up and run with before the OP made it clear what was actually wanted. For instance, what is meant by "sampling a 23 bit number"?Baluncore said:There was no OP mention of fast transform algorithms or data compression

Data compression must be involved here if the OP also requires "downsampling" and a reduction in bits (per sample??). You can downsample many signals without loss if you are prepared to use more bits per sample

It would help if the task were defined more clearly. It is probably a very specific thing that the OP has been given.

Downsampling is the process of reducing the resolution or bit depth of a numerical value. In the context of a 23 bit number being downsamples to 8 bits, this means reducing the number from 23 binary digits (bits) to 8 binary digits.

There are several reasons why downsampling a 23 bit number to 8 bits may be necessary. One possible reason is to save memory or storage space. Another reason could be to fit the number into a system or device that only accepts 8 bit numbers.

Downsampling a number to a lower bit depth will result in a loss of precision and accuracy. This is because fewer bits means there are fewer possible values that can be represented. In the case of downsampling from 23 bits to 8 bits, there will be a significant loss of accuracy.

There are several methods that can be used to downsample a number, including truncation, rounding, and quantization. Each method has its own advantages and drawbacks, and the choice of method will depend on the specific needs and requirements of the application.

When downsampling a number, it is important to consider the potential loss of accuracy and the impact this may have on the results of any calculations or analyses using the downsampled number. It is also important to carefully choose the downsampling method to minimize any potential errors or distortions.

- Replies
- 1

- Views
- 2K

- Replies
- 9

- Views
- 1K

- Replies
- 8

- Views
- 2K

- Replies
- 12

- Views
- 10K

- Replies
- 1

- Views
- 2K

- Replies
- 1

- Views
- 9K

- Replies
- 4

- Views
- 3K

- Replies
- 7

- Views
- 1K

- Replies
- 2

- Views
- 2K

- Replies
- 9

- Views
- 2K

Share: