示例#1
0
 public void Load(string fileName, int fftLength, ShortTimeFourierTransform stft)
 {
     this.ShortTimeFourierTransform = stft;
     Stop();
     CloseFile();
     EnsureDeviceCreated();
     OpenFile(fileName, fftLength);
 }
示例#2
0
 public STFTSampleProvider(ISampleProvider source, ShortTimeFourierTransform shortTimeFourierTransform, int fftLength = 1024)
 {
     if (!IsPowerOfTwo(fftLength))
     {
         throw new ArgumentException("FFT Length must be a power of two");
     }
     this.ShortTimeFourierTransform = shortTimeFourierTransform;
     this.source = source;
 }
示例#3
0
 public void DisplaySpectrogram(string filePath)
 {
     // analyser = new ShortTimeFourierTransform(filePath, double.Parse(fResolutionTxt.Text), double.Parse(timeStepTxt.Text));
     analyser          = new ShortTimeFourierTransform(filePath, int.Parse(fftSizeTxt.Text), double.Parse(timeStepTxt.Text));
     spectrogram       = new RainbowSpectrogram(analyser, int.Parse(textBox1.Text));
     analyser.Ended   += OnEnded;
     OriginalBitmap    = spectrogram.Generate();
     pictureBox1.Image = (Bitmap)OriginalBitmap.Bitmap.Clone();
 }
示例#4
0
 public RainbowSpectrogram(ShortTimeFourierTransform stft, int maxFrequency, double significantAmplitude = 80) : base(stft, maxFrequency)
 {
     this.SignificantAmplitude = significantAmplitude;
 }
示例#5
0
 public Spectrogram(ShortTimeFourierTransform stft, int maxFrequency)
 {
     this.MaxFrequency = maxFrequency;
     this.Analyser     = stft;
     this.TimedAnalyse = new List <SampleAnalysis[]>();
 }
示例#6
0
 public LinearSpectrogram(ShortTimeFourierTransform stft, int maxFrequency) : base(stft, maxFrequency)
 {
     this.Colors = GetDefaultColors();
 }