emd.spectra.define_hist_bins¶
- emd.spectra.define_hist_bins(data_min, data_max, nbins, scale='linear')[source]¶
Define the bin edges and centre values for use in a histogram.
- Parameters
- data_minfloat
Value for minimum edge
- data_maxfloat
Value for maximum edge
- nbinsint
Number of bins to create
- scale{‘linear’,’log’}
Flag indicating whether to use a linear or log spacing between bins (Default value = ‘linear’)
- Returns
- edgesndarray
1D array of bin edges
- centresndarray
1D array of bin centres
Notes
An example creating histogram bins between 1 Hz and 5 Hz with four linearly spaced bins.
>>> edges,centres = emd.spectra.define_hist_bins(1, 5, 4) >>> print(edges) [1. 2. 3. 4. 5.] >>> print(centres) [1.5 2.5 3.5 4.5]