public bool filter(sid_filter_t filter) { int[][] fc = new int[0x802][]; for (int i = 0; i <= fc.GetLength(0); i++) { fc[i] = new int[2]; } int[][] f0 = fc; int points = 0; if (filter == null) { // Select default filter // m_sid.fc_default(f0, points); FCPoints fcp = new FCPoints(); m_sid.fc_default(fcp); fc = fcp.points; points = fcp.count; } else { // Make sure there are enough filter points and they are legal points = filter.points; if ((points < 2) || (points > 0x800)) { return(false); } { int[] fstart = { -1, 0 }; int[] fprev = fstart; int fin = 0; int fout = 0; // Last check, make sure they are list in numerical order for both axis while (points-- > 0) { if ((fprev)[0] >= filter.cutoff[fin][0]) { return(false); } fout++; fc[fout][0] = filter.cutoff[fin][0]; fc[fout][1] = filter.cutoff[fin][1]; fprev = filter.cutoff[fin++]; } // Updated ReSID interpolate requires we repeat the end points fc[fout + 1][0] = fc[fout][0]; fc[fout + 1][1] = fc[fout][1]; fc[0][0] = fc[1][0]; fc[0][1] = fc[1][1]; points = filter.points + 2; } } // function from reSID points--; m_sid.filter.interpolate(f0, 0, points, m_sid.fc_plotter(), 1.0); if (filter != null && filter.Lthreshold != 0) { m_sid.set_distortion_properties(filter.Lthreshold, filter.Lsteepness, filter.Llp, filter.Lbp, filter.Lhp, filter.Hthreshold, filter.Hsteepness, filter.Hlp, filter.Hbp, filter.Hhp); } return(true); }
public void fc_default(FCPoints fcp) { filter.fc_default(fcp); }
// ---------------------------------------------------------------------------- // Spline functions. // ---------------------------------------------------------------------------- /// <summary> /// Return the array of spline interpolation points used to map the FC /// register to filter cutoff frequency. /// </summary> /// <param name="fcp">IN/OUT parameter points and count</param> public void fc_default(FCPoints fcp) { fcp.points = f0_points; fcp.count = f0_count; }