Skip to content

Commit

Permalink
Window Inspector: improve symmetry
Browse files Browse the repository at this point in the history
  • Loading branch information
swharden committed Oct 27, 2021
1 parent ec19e25 commit 62ac992
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/FftSharp.Demo/FormWindowInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private void lbWindows_SelectedIndexChanged(object sender, EventArgs e)

private void UpdateTimePlot(IWindow window)
{
double[] xs = ScottPlot.DataGen.Consecutive(100);
double[] xs = ScottPlot.DataGen.Consecutive(101);
double[] ys = window.Create(xs.Length);

plotWindow.Plot.Clear();
Expand All @@ -50,6 +50,9 @@ private void UpdateFrequencyPlot(IWindow window)
double[] windowed = window.Apply(ys);
double[] power = Transform.FFTpower(windowed);

// hide DC component
power[0] = power[1];

plotFreq.Plot.Clear();
var sig = plotFreq.Plot.AddSignal(power, fftSize / 2);
sig.OffsetX = -.5;
Expand Down

0 comments on commit 62ac992

Please sign in to comment.