Example #1
0
        public MetricFFTBandEnergy(Graph graph) : base("Band Energy", graph)
        {
            _portInp = new NodeSystemLib2.FormatDataFFT.InputPortDataFFT(this, "In");
            _portOut = new NodeSystemLib2.FormatData1D.OutputPortData1D(this, "Out");

            _portInp.SamplerateChanged += (s, e) => _portOut.Samplerate = e.NewSamplerate / _portInp.FFTSize;

            _attrBandwidth       = new AttributeValueDouble(this, "Bandwidth", "Hz");
            _attrCenterFrequency = new AttributeValueDouble(this, "Center Frequency", "Hz");
        }
Example #2
0
 private void UpdateDisplay(NodeSystemLib2.FormatDataFFT.InputPortDataFFT port)
 {
     labelTime.Text = "Time: " + port.Time.AsTimeSpan().ToString("c");
     if (port.Capacity == 0)
     {
         SetPercent(0);
     }
     else
     {
         SetPercent(port.Available / (double)port.Capacity);
     }
 }