-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (28 loc) · 942 Bytes
/
Copy pathProgram.cs
File metadata and controls
30 lines (28 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FFT
{
class Program
{
static void Main(string[] args)
{
int period = 1024;
int[] signal = Generator.GetSin(period, 30, 128);
int[] signal2 = Generator.GetSin(period, 1.5, 0);
signal = Generator.CombineSignal(signal, signal2);
//signal = GetMeandr(period);
Complex[] output = FFT.CalcForward(signal);
var pl = new PlotWindow("signal", signal);
var p2 = new PlotWindow("FFT", Converter.ComplexToInt(output, 0.03, true));
var p3 = new PlotWindow("sin", Converter.ComplexToInt(FFT.CalcBackward(output)));
Console.WriteLine("Waiting for exit...");
Console.ReadKey();
}
}
}