void Pattern_draw (Pattern me, Graphics g, long pattern, double xmin, double xmax, double ymin, double ymax, int garnish) { Matrix_drawRows (me, g, xmin, xmax, pattern - 0.5, pattern + 0.5, ymin, ymax); if (garnish) { Graphics_drawInnerBox (g); Graphics_marksBottom (g, 2, true, true, false); Graphics_marksLeft (g, 2, true, true, false); } }
void BandFilterSpectrogram_and_PCA_drawComponent (BandFilterSpectrogram me, PCA thee, Graphics g, long component, double dblevel, double frequencyOffset, double scale, double tmin, double tmax, double fmin, double fmax) { if (component < 1 || component > thy numberOfEigenvalues) { Melder_throw (U"Component too large."); } // Scale Intensity autoBandFilterSpectrogram fcopy = Data_copy (me); BandFilterSpectrogram_equalizeIntensities (fcopy.get(), dblevel); autoMatrix mdb = Spectrogram_to_Matrix_dB ((Spectrogram) fcopy.get(), BandFilterSpectrogram_DBREF, BandFilterSpectrogram_DBFAC, BandFilterSpectrogram_DBFLOOR); autoMatrix him = Eigen_and_Matrix_to_Matrix_projectColumns (thee, mdb.get(), component); for (long j = 1; j <= my nx; j++) { his z[component][j] = frequencyOffset + scale * his z[component][j]; } Matrix_drawRows (him.get(), g, tmin, tmax, component - 0.5, component + 0.5, fmin, fmax); }
void FilterBank_and_PCA_drawComponent (I, PCA thee, Graphics g, long component, double dblevel, double frequencyOffset, double scale, double tmin, double tmax, double fmin, double fmax) { iam (FilterBank); if (component < 1 || component > thy numberOfEigenvalues) { Melder_throw (U"Component too large."); } // Scale Intensity autoFilterBank fcopy = (FilterBank) Data_copy (me); FilterBank_equalizeIntensities (fcopy.peek(), dblevel); autoMatrix him = Eigen_and_Matrix_project (thee, fcopy.peek(), component); for (long j = 1; j <= my nx; j++) { fcopy -> z[component][j] = frequencyOffset + scale * fcopy -> z[component][j]; } Matrix_drawRows (fcopy.peek(), g, tmin, tmax, component - 0.5, component + 0.5, fmin, fmax); }
void Spectrum_drawPhases (Spectrum me, Graphics g, double fmin, double fmax, double phase_min, double phase_max, int unwrap, int garnish) { autoMatrix thee; int reverse_sign = my z[1][1] < 0; if (unwrap) { thee = Spectrum_unwrap (me); } else { thee = Matrix_create (my xmin, my xmax, my nx, my dx, my x1, 1.0, 2.0, 2, 1.0, 1.0); for (long i = 1; i <= my nx; i ++) { thy z[2][i] = PPVPHA (my z[1][i], my z[2][i], reverse_sign); } } Matrix_drawRows (thee.get(), g, fmin, fmax, 1.9, 2.1, phase_min, phase_max); if (garnish) { } }
void VocalTract_draw (VocalTract me, Graphics g) { Matrix_drawRows (me, g, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); }