• We've upgraded our forums. Please post any issues/requests in this thread.

creating a graph in c++

May 27, 2008
3,577 (1.03/day)
Huddersfield, uk
Processor E8200
Motherboard Asus P5KC
Cooling cooler master hyper tx3, 2x 120mm, 1x 80mm
Memory 4 GB DDR3 OCZ Black Edition
Video Card(s) Gigabyte HD 2600xt silent pipe II
Storage 500GB WD Sata / 60 GB Samsung IDE
Display(s) 20" samusng LCD, gaming at 1680 x 1050
Case some old amd thing
Audio Device(s) onboard
Power Supply 650W
Software Windows 8.1, with 'start is back' obviously
Benchmark Scores It boots whilst im still young so im pleased with that.
hi all

Basically im implementing FFTW 3.3.3 on a block of audio samples that is updated at a predefined interval and ive got it running what i think is quite well. im inputting a real number samples through the Steinberg VST SDK and FFTW is outputting a complex number, what i want to do now is plot the output and have the plot refresh with the new output as i feed it with the new input so i can fine tune it and see visually if its detecting the various test frequencies i feed it so i can decide on the best trade of between performance and resolution. However i have no idea how to do what ive come to see as such a trivial thing as plot one number against the other. It doesn't need to be visually amazing or huge amounts of functionality just plot one number against the other, when im sure my FFT is working the plot wont be used, its just for testing.

I understand the complex number is an array of the real (out[0]) and imaginary (out[1]) numbers however im not too sure how i get the frequency and amplitude from that data to actually plot. Ive read i have to convert it to a real number but then that would leave me with a single array of data like the input :/

Hope all this makes sense thanks in advance for any help :toast:
Dec 2, 2009
3,257 (1.11/day)
System Name Mercury KM-81
Processor Phenom II x4 B50
Motherboard ASUS M4A89GTD PRO
Cooling Cooler Master Hyper TX3
Memory 6GB Ram (4GBx1 Corsair 2GBx1 Nanya)
Video Card(s) PowerColor AX6770 V2.0
Storage 2TB WD Black, 1TB Hitachi, 500 GB WD Blue
Display(s) Philips 247E-LPH 24" 1920x1080
Case Mercury
Audio Device(s) Integrated Realtek
Power Supply Corsair 750TX
Software Windows 7 64-bit
Benchmark Scores Maybe it is time to benchmark :D
I think you would first need an update loop, using a boolean true value which will make you update your graph or at least display it on the screen.
Than, I would say to experiment and give out a formula on how that real number you are trying really outputs. In reality that array you are talking about is in fact a real number:
out[0] == 40
out[1] == 45
out[2] == 55
out[n] == real number

Try to combine values by adding first 5 to each one, than add 10 or increment with at least 1.
This way can make you find a formula which will make you create whatever graph you want, no matter how complex it is.