Very nice, but I still have no idea what it would actually be useful for
I present to you the effect of my recent work, the FT chip. FT stands for Fourier Transform. Basically it allows you to see what frequencies are there in a signal.
The chip itself just performs something like FFT, though not exactly. I modified the FFT algorithm to resemble the continuous version of the FT more. I made also two other chips, the "Gauss Generator", which generated a Gauss function at first and can now do sin(x) and square pulse too, and "Grapher", which graphs the effect on the oscilloscope.
This could probably be used for some kind of smoothing or something, if someone wanted to, but it would still require quite a lot of work
The left screen shows the generated function, the right shows its FT. For the sine function, you can clearly see a peak at some frequency. Changing the frequency moves the peak, you can test that
- Spawn the dupe.
- To control the function, use the chat. Commands are like this:
!fun function [resolution [parameter]]
"function" can be "sin", "gauss" or "square". Resolution means how much points there will be in the arrays, defaults to 20. Parameter is a parameter For Gauss, it's the width of the distribution, for square it's the width of the pulse, for sine it's the frequency. The parameter defaults to 1.
For example "!fun sin 40 2" defines a sine wave calculated for 40 points, with frequency of 2 (2 periods will be visible).
- When you defined a function, the left oscilloscope reacts immediately. For the right oscilloscope to update, you need to press the "Cake" button. FT calculation is quite expensive, so it doesn't do it for every trigger.
Adv. dupe and codes of all 3 chips are in the attachments.
PS. The code is a bit messy, because the arrays can't contain complex numbers (TomyLobo, fix it ) and I had to work around that. Also I wasn't sure if arrays trigger inputs properly, so I used GLON to pass the arrays between chips.
Honestly, I have pretty much no idea too It's fun to process images using FT, but I don't think GMod can handle images big enough to actually see the effect (blurring, sharpening etc. - using FT it's very easy to do).
You can make a RC car or anything remote controlled using radio as analog transmitter. The transmitter will add multiple sine functions of different frequencies (each multiplied by desired value from 0 to 1) and then use FT on receiver as demodulator But it would be too slow to be used i think... still it can be an interesting experiment
It could end world hunger or it could destroy the world. Fizyk once again proves his reputation of unquestionable genius of math
FT is closely related to my attempts to synthesize music taken from wav files through wiremod sinewave sound emitters. But I still can't figure out what I'm supposed to do.
Last edited by Nikita; 01-23-2010 at 06:03 PM.
The problem is - I don't know either, what you could do with FT to achieve sound synthesis :P Sound synthesis is a really complex task and I think doing it in GMod will be extremely hard, if not impossible.