//-----------------------------------
// sample code to execute go_fft
// ver: 1.0 
//-----------------------------------

//set lib path
//Please change the following path to fit your enviroment. 
getf('C:\work\scilab\go_fft.sci');

//generate test wave
fs = 10000;
f_1 = 1250;
f_2 = 2500;
n = [1:1:8192];
sine_1 = 0.5 * sin(2*%pi*(f_1/fs)*n);
sine_2 = 0.25 * sin(2*%pi*(f_2/fs)*n);
input_wave = sine_1 + sine_2; 

//go fft
[amp f] = go_fft(input_wave, fs, 're', 'lnr'); //plot in linear unit
//[amp f] = go_fft(input_wave, fs, 're', 'dB'); //plot in dB unit 
//[amp f] = go_fft(input_wave, fs, 'hn', 'lnr'); //use hanning window
//[amp f] = go_fft(input_wave, fs, 'hm', 'lnr'); //use hamming window

//display fft result
plot(f, amp);
xgrid; //grid on


