Issue link: http://dc.ee.ubm-us.com/i/71837

Working implementation of FHT
whi le(1) {
From++; To++; FromRetrograde--; if( To == To_QuadrantEnd ) break; CSTenn = •Sinptr * FromRetrograde[OJ - •Cosptr * From[ButterflyWidthJ;
To[OJ = Frani:OJ + CSTenn; To[ButterflyWidthJ = From[OJ - CSTenn; Sinptr -= ButterflyBlocks; Cosptr += ButterflyBlocks;
}
From += ButterflyWidth; To += ButterflyWidth;
}
ButterflyWidth <<= 1; ButterflyBlocks >>= 1; SwapTE!fl1l = FrcrnArray; I I Swap "from" and "to" arrays FrcrnArray = ToArray; ToArray = SwapTE!fl1l;
} } void PowerSpectrum(DataType *PQWer, DataType *dht, int nBits)
II converts Hartley transfonn dht[O .•. N-1] into power spectrum 11 power[O ... NI2J. The power spectrum array is one entry longer than 11 half as long as the DHT because it is symmetrical after the 11 mid-frequency anyway. It is OK to call with power=dht and use II only the first Nl2+1 elements of dht on return.
{ unsigned int N, i,r.ninusl; N = 1 « nBits;
for(i=O; i <= Nl2; i++) {
r.ninusl = (i==O)? 0 : * loop return FrcrnArray;
· · . ," · · · :. · ··· ,.
sented in terms of Hartley transforms
oflength 4. H0 is decomposed into Hoo and H01, H10
while H1 and H11. is decomposed into The numbers 0 through
3 are indice into these smaller Hartley transforms. The recursion process continues all
the way back to the first column, where we would have 16 Hartley trans- forms of length l. Equation 1 shows that a Hartley transform of a time sequence of length 1 is just the origi- nal time sequence itself. So the first column represents values from the original time sequence X(t) . The num- bers in that column are the indices into the original time sequence, X( t). But how did tl1ey get into that strange order? To answer tl1is question we must de termine exactly which
time
sequence is transformed into each of the Hartley transforms in Figure 2. Starting again at the right, we know that the fu ll Hartley transform is derived from the original time sequence X(O) through X(15) in nor- mal order. Going back one step in the recursion and recalling how the small- er Hartley transforms in Equations 3 and 4 were defined, we see that H1 the Hartley transform of the sequence
i
X(O), X(2), ... , X(14) and H1 is the Hartley transform of the sequence X(1 ), X(3), .. . , X(15) . Purely as a com- putational convenience, we place the time sequence for H1 after the time sequence for H0. We have effectively sorted the sequence, X, according to the least-significant bit of its indices. In going from Hartley transf01·ms
of length 8 to Hartley transforms of length 4, we further refine tl1e sort on X ba ed on the next-least-significant bit of its indices. That is:
H00 is based on {X(O) , X(4), X(8) , X(l2)} H01
is based on {X(2) , X(6) , X(l O) , X(l4)} H10 is based on {X( l ) , X(5) , X(9), X(l 3)}
H11 i based on {X(3) , X(7) , X(ll ), X(l5)} At each stage in this progressive
sort, the results of th e previous sort are preserved. Therefore when we*

- September001
- September002
- September003
- September004
- September005
- September006
- September007
- September008
- September009
- September010
- September011
- September012
- September013
- September014
- September015
- September016
- September017
- September018
- September019
- September020
- September021
- September022
- September023
- September024
- September025
- September026
- September027
- September028
- September029
- September030
- September031
- September032
- September033
- September034
- September035
- September036
- September037
- September038
- September039
- September040
- September041
- September042
- September043
- September044
- September045
- September046
- September047
- September048
- September049
- September050
- September051
- September052
- September053
- September054
- September055
- September056
- September057
- September058
- September059
- September060
- September061
- September062
- September063
- September064
- September065
- September066
- September067
- September068
- September069
- September070
- September071
- September072
- September073
- September074
- September075
- September076
- September077
- September078
- September079
- September080
- September081
- September082
- September083
- September084
- September085
- September086
- September087
- September088
- September089
- September090
- September091
- September092
- September093
- September094
- September095
- September096
- September097
- September098
- September099
- September100
- September101
- September102
- September103
- September104
- September105
- September106
- September107
- September108
- September109
- September110
- September111
- September112
- September113
- September114
- September115
- September116
- September117
- September118
- September119
- September120
- September121
- September122
- September123
- September124
- September125
- September126
- September127
- September128
- September129
- September130
- September131
- September132
- September133
- September134
- September135
- September136
- September137
- September138
- September139
- September140
- September141
- September142
- September143
- September144
- September145
- September146
- September147
- September148
- September149
- September150
- September151
- September152
- September153
- September154
- September155
- September156
- September157
- September158
- September159
- September160
- September161
- September162
- September163
- September164
- September165
- September166
- September167
- September168
- September169
- September171
- September172
- September173
- September174
- September175
- September176
- September177
- September178
- September179
- September180
- September181
- September182
- September183
- September184
- September185
- September186
- September187
- September188
- September189
- September190
- September191
- September192
- September193
- September194
- September195
- September196
- September197
- September198
- September199
- September200
- September201
- September202
- September203
- September204
- September205
- September206
- September207
- September208
- September209
- September210
- September211
- September212
- September213
- September214
- September215
- September216
- September217
- September218
- September219
- September220
- September221
- September222
- September223
- September224
- September225
- September226
- September227
- September228
- September229
- September230
- September231