EasyManuals Logo

Sinclair QL User Manual

Sinclair QL
422 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #308 background imageLoading...
Page #308 background image
Examples
The
entire
table,
and the end-of-year balances should
be
set
to
either monetary
format or
to
decimal format
with
two places
of
decimals. The ranges for these
changes
are
C20:AK3l and C35:AK35.
FOURIER
ANALYSIS
Calculating
the
Fourier
Transform
The
Cosine
Components
The French scientist
FOUrier
showed that a repetitive
wave
of
any
shape can be built
up
from
a
set
of
sine or cosine waves of the correct amplitudes and frequencies.
The
building up
of
complex
waves
from
pure sine and cosine waves
is
known
as
FOUrier
synthesis and
is
employed,
for
example,
in
many
of
the
mUSIC
syntheslsers
in
use today.
The
opposite process, decomposing a complex
wave
shape
Into
a number
of
pure sine
and cosine
waves,
is
known
as
Fourier
analySIS.
This example allows
you
to
perform
a Fourier analysis
of
any
shape
of
wave.
All
you
have
to
do
IS
type
in
the height
of
the
wave
at
sixteen equally spaced intervals and
let
the formulae
in
the grid do the
rest.
The formulae assume that the
wave
repeats
its
shape after the sixteenth
value,
i.e.
that
the seventeenth value
is
the same
as
the
first,
the eighteenth
is
the same as the second,
and so
on.
Since the calculation
takes
an
appreciable time
it
is
worth turning
off
the auto-calculate,
by
use
of
the Design command, before typing
in
the example.
[Cl]
"FOURIER ANALYSIS
[C2]
rept("=",len(c1»
[83J
"Function:
[Al]
"Input
[AB]
"Va
Lues
The input values
are
placed
in
the sixteen cells
from
89
to
824 Inclusive.
co L=row 0
-9
[rows 9
to
24]
We
shall
now
set
up
the
headings
for
the table which
will
calculate the cosine components
of
the
wave.
The result contains the amounts
of
all
cosine-like waves
in
the Input.
[E3]
"Transform:
[E4]
"Cosine
[06]
"Cycles
row=co L0
-5
[columns E
to
TJ
[08J
"Samp I e
Surprisingly, the entire cosine transformation can
be
performed by a
Single
formula.
In
each
row
the input value
is
multiplied by the cosine
of
an
angle
(in
radians)
which
is
calculated
as
follows:
angle = 2 *
pi()
* rownumber * colnumber /
16
The
row
number and column number
are
the values given
in
the row labelled
'Cycle'
and the column labelled 'Sample' respectively. They each count up from zero
to
fifteen.
The
final
divisor
is
simply the number
of
points
in
the input (or output).
[E9]
index(2,rowO)*cos(pi
O*(rowO-9)*(coLO-5)/S)
Now use the Echo command
to
copy the contents
of
cell
E9
to
the cells
in
the range
from
E10
to
T24.
The final result
is
calculated
by
summing the contents of each column
to
produce the
sixteen output
values.
[A26] "Component s
[E26]
row=sum(coL)
[rows 9
to
24,
columns E
to
TJ
The
Sine
Components
The
calculation
of
the
sine
components follows exactly the same pattern
as
for the cosine
ones.
The resulting values
are
the amounts
of
all
sine-like waves
in
the input.
[X4J
"Sine
[X6]
row=colO-24
[columns X
to
AM)
[X9]
index(2,rowO)*sin(piO*(rowO-9)*(coLO-24)/S)
[columns
X
to
AMI
32
12/84

Other manuals for Sinclair QL

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair QL and is the answer not in the manual?

Sinclair QL Specifications

General IconGeneral
ProcessorMotorola 68008
Clock Speed7.5 MHz
RAM128 KB (expandable to 640 KB)
ROM48 KB
Operating SystemSinclair QDOS
Release Year1984
StorageMicrodrive tape loop
Graphics256x256 pixels, 8 colors
PortsRS-232, ROM cartridge
SoundBeeper (internal speaker)

Related product manuals