Ieri sera stavo pensando a come poteva essere possibile elaborare la trasformata di fourier utilizzando una tabella precalcolata ed il povero Megahertz del nostro biscottone. La routine é ancora da sistemare ma permette già di ottenere alcuni risultati.
Vi propongo il source:
; Fast fourier transform with precalculated values
*=$1000
lda #<Data
sta $fb
eor #<Data
sta $fd
clc
sbc #$00
sta $fe
lda #>Data
sta $fc
ldx #$00 ; Contatore 8
ldy #$00 ; Contatore 5
mainloop
cpy #$00
bne stp1
lda ($fb),y
inc $fb
pha
lda $fb
cmp #<EndData+1
pla
bcs end1
stp1
asl
rol $fa
inx
iny
cpx #$05
bne stp2
pha
tya
pha
ldy #$00
lda $fa
bne stp3
sec
ror
ror
ror
stp3
sta ($fd),y
inc $fd
sty $fa
pla
tay
pla
ldx #$00
stp2
cpy #$08
bne end0
ldy #$00
end0
jmp mainloop
end1
rts
Data
byte $68,$41,$1A,$85,$D4,$78,$24,$F6,$C1,$EE,$78,$18,$50,$08,$2C,$61,$41,$3A,$24,$0C
byte $0B,$4B,$20,$11,$20,$69,$64,$40,$80,$00,$00,$26,$50,$05,$8D,$2B,$9E,$0B,$3D,$20
byte $73,$DC,$06,$3C,$13,$49,$68,$50,$14,$13,$A0,$68,$50,$30,$A7,$39,$5C,$47,$80,$89
byte $A1,$40,$C0,$82,$CF,$9D,$24,$10,$38,$AC,$05,$11,$22,$84,$80,$00,$00,$C2,$82,$12
byte $4B,$4A,$0A,$48,$A0,$80,$64,$F6,$14,$04,$2B,$01,$67,$CE,$92,$78,$20,$F9,$D0,$04
byte $7D,$A4,$17,$39,$E0,$80,$65,$44,$C8,$A0,$1B,$DC,$06,$04,$0C,$2D,$28,$59,$04,$01
byte $00,$00,$08,$16,$40,$4B,$01,$22,$CE,$8F,$01,$83,$42,$82,$AE,$04,$1E,$02,$24,$13
byte $0B,$82,$04,$C9,$EE,$48,$40
EndData
Attendo anche altre soluzioni!