//this is the blackman harris windowing function that will do a windowed //dft on the selection of the data. private void blackmanHarrisToolStripMenuItem_Click(object sender, EventArgs e) { double[] windowWave = WindowingClass.BlackmanHarrisWindow(selectedWave()); double[] sendDataWave = new double[dataWave.Length]; for (int i = 0; i < dataWave.Length; i++) { sendDataWave[i] = dataWave[i]; } WindowForm newMDIChild = new WindowForm(); newMDIChild.DataWave = sendDataWave; newMDIChild.WindowWave = windowWave; // Set the Parent Form of the Child window. newMDIChild.MdiParent = this.MdiParent; newMDIChild.Show(); }
//this is the hamming windowing function that will do a windowed //dft on the selection of the data. private void hammingToolStripMenuItem_Click(object sender, EventArgs e) { double[] windowWave = WindowingClass.HammingWindow(selectedWave()); double[] sendDataWave = new double[dataWave.Length]; for (int i = 0; i < dataWave.Length; i++) { sendDataWave[i] = dataWave[i]; } WindowForm newMDIChild = new WindowForm(); newMDIChild.WaveHeader = wavhdrW; newMDIChild.DataWave = sendDataWave; newMDIChild.WindowWave = windowWave; // Set the Parent Form of the Child window. newMDIChild.MdiParent = this.MdiParent; // Display the new form. newMDIChild.Show(); }
private void highPassToolStripMenuItem_Click(object sender, EventArgs e) { //this is where the 1-0 mask is designed. var filterWeights = new complex[windowWave.Length]; if ((windowWave.Length % 2) != 0) { filterWeights[(filterWeights.Length / 2)] = new complex(1, 1); } for (int i = 0; i < filterWeights.Length / 2; i++) { if (i > (int)chart1.ChartAreas[0].CursorX.SelectionStart) { filterWeights[i] = new complex(1, 1); filterWeights[filterWeights.Length - i - 1] = new complex(1, 1); } else { filterWeights[i] = new complex(0, 0); filterWeights[filterWeights.Length - i - 1] = new complex(0, 0); } } //after the 1-0 mask is designed, it will iDFT it, window it, //then convolve it across the original data and finally send //it to a form2 to be displayed. if (windowtype == 1) { convolver(WindowingClass.TriangleWindow(transform.inverseDFT(filterWeights))); } else if (windowtype == 2) { convolver(WindowingClass.BlackmanHarrisWindow(transform.inverseDFT(filterWeights))); } else if (windowtype == 3) { convolver(WindowingClass.HammingWindow(transform.inverseDFT(filterWeights))); } else { convolver(transform.inverseDFT(filterWeights)); } }