Sha256: 65906cfe5d26d01087ea9e241dbcf9c268bf923e7a0d7f367177b7c26c514274

Contents?: true

Size: 918 Bytes

Versions: 7

Compression:

Stored size: 918 Bytes

Contents

plt = Dsp::QuickPlot
gauss = Dsp::Probability::RealizedGaussianDistribution
fns = Dsp::Functions

distribution = gauss.new(mean: 0, stddev: 10, size: 100)
data = distribution.data

#qplot function in quickplot gives a different plot API
plt.qplot(data: data, path: './examples/realized_gaussian/', filename: 'norm_dist_plot', xsteps: 10, data_name: "normal random numbers") do |g|
    g.title = "Gaussian Random Numbers"
    g.theme = Dsp::Plottable::Styles::MIDNIGHT
    g.show_vertical_markers = false
end

spectra = fns.fft(data).map(&:abs)
x_vals = fns.linspace(0,128,128)

plt.qplot(data: spectra, path: './examples/realized_gaussian/', filename: 'norm_dist_spectrum', xsteps: 4, xyname: "spectra mag. of norm. random nums") do |g|
    g.title = "Gaussian Nums: Frequency Domain"
    g.labels = {0 => 0, 32 => 0.25, 64 => 0.5, 98 => 0.75, 127 => 1}
    g.show_vertical_markers = false
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
digiproc-0.2.5 examples/realized_gaussian/realized_gaussian_example.rb
digiproc-0.2.4 examples/realized_gaussian/realized_gaussian_example.rb
digiproc-0.2.3 examples/realized_gaussian/realized_gaussian_example.rb
digiproc-0.2.2 examples/realized_gaussian/realized_gaussian_example.rb
digiproc-0.2.1 examples/realized_gaussian/realized_gaussian_example.rb
digiproc-0.2.0 examples/realized_gaussian/realized_gaussian_example.rb
digiproc-0.1.0 examples/realized_gaussian/realized_gaussian_example.rb