Forum Discussion
Altera_Forum
Honored Contributor
16 years ago --- Quote Start --- By the way the spectrum is always mirrored at half the sample rate. The information above fs/2 is redundant and obviously not helpful. Why is this output? I could save half the memory by dropping the data above fs/2. Is this correct? --- Quote End --- yes and no. If you don't want phase information then yes. amplitude is symmetrical around dc(and around Fs/2 as well) but phase may not be. The issue becomes relevant if you frequency shift your sinusoid to higher point e.g. move from dc to a carrier at 1MHz then you get two side bands, one from each side of your baseband (around dc or each side of Fs/2). --- Quote Start --- Another issue is, that referring to Alteras documentation, it seems to me that Altera does not differ between integer and fixed-point data format. Theortically that is not the same, but if +0,9999999 (fixed-point) or +32767 (integer) is just a question of interpretation, istn't it? The digital number I give the FFT module is the same, in this case 0x7FFF (16bit). --- Quote End --- integers are represented as fixed point. If you think of .1, .2 ...etc then they are first scaled to integers to be represented on the binary ladder of 16bits. Scaling is up to your flavour,possible signal range and some other factors. --- Quote Start --- --output unscaled 0x7FFF -- output scaled: shifting e.g. four times left (mult) 0x7FFF0 --> 0x7FFF when taking the upper 16bits I win no new information with this multiplication, do I? --- Quote End --- The issue of scaling makes sense only if there is room to scale, otherwise altera got it wrong ! Frankly I don't understand why altera left scaling for the field engineer. --- Quote Start --- for mult:shift magnitude bits towards sign bit inserting leading zeros. Should I scale the magnitude? I think you mean I should scale real and imginary parts. We should not mix the terms here. This is confusing. --- Quote End --- magnitude bits as opposed to sign bit, context obvious --- Quote Start --- I do not get neraly identical bins at neraly my amplitude value. I monitored the direct output signals of the FFT Megacore instance with the SignaltapII and I got 0x0D38 (real) and 0xC7C9 (imag) at the output for the frequency part I'm interested in. The exponent output shows 0x36 for the entire block. So this is not a bug in the wrapper I wrote around the FFT instance. That's why I asked for the input format, too. Maybe the input is not correct. about scaling: (why you say input is 16 bits, output is 31 ?) if altera says divide output by 2^exp i.e. multiply by 2^-exp then: I said the output is 31 bit, because I referred to the FFT user guide, where it is mentioned that you have to extend your output by the maximum number of shifts, that is possible... in my case 15bits. Since I'am using the NiosII processor to process the results I can use the entire 31 bits for a high resolution, if I want. But where is the difference between these: --- Quote End --- The exponent has to be a small value and having 15 bits is unreasonable. Do you mean maximum exponent value can reach 2^15 -1 = 32767 Do you then mean you shift 32767 bits. Altera IP gurus must limit the exponent to a realistic value in harmony with output bit width.