.net spectrum calculator in c#