Git Product home page Git Product logo

nebula's People

Contributors

sleepwalking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hedgefair entn-at

nebula's Issues

A simple OCTAVE script converting the generated datasets to CSV files which could be loaded in other interpreters

Inspired by train/make_random_dataset.m, many thanks for @Sleepwalking .

pkg load control;
pkg load signal;

rand("state", 128); % Setting Random States to make results reproducible
randn("state", 39); % Setting Random States to make results reproducible
startup;

wtype = 'nuttall98';
stype = 'hanning';

fs = 8000;
nch = 36;
fc = logspace(log10(40), log10(1000), nch)' / fs;
fres = fc;

data = {};
num_samples = 0;

eps = 1e-10;
for i = 1:3600
    printf("%d/%d\n", i, 100); fflush(stdout);

    global_snr = db2mag(rand * 100 - 50);
    f0 = (40 + (1000 - 40) * rand) / fs;
    [x naxis] = make_random_signal(f0, 10000, global_snr);

    [SNR1 IF1 SNR2 IF2 SNR0] = estimate_ifsnr(x, naxis, fc, fres, wtype, stype);

    data{i}.SNR0 = mag2db(max(SNR0, eps));
    data{i}.SNR1 = mag2db(max(SNR1, eps));
    data{i}.SNR2 = mag2db(max(SNR2, eps));
    data{i}.IF1 = IF1 * fs;
    data{i}.IF2 = IF2 * fs;
    data{i}.f0 = f0 * fs;

    num_samples += rows(SNR0);
end

for i = 1:nch
    samples = zeros(num_samples, 6);
    idx = 1;
    for j = 1:length(data)
        num = rows(data{j}.SNR0);
        F0 = data{j}.f0 * ones(num, 1);
        samples(idx:idx + num - 1, :) = [ ...
        data{j}.SNR1(:, i)  ...
        data{j}.SNR0(:, i)  ...
        data{j}.SNR2(:, i)  ...
        data{j}.IF1(:, i)   ...
        data{j}.IF2(:, i)   ...
        F0                  ...
        ];
        idx += num;
    end
    csvwrite(sprintf("_ichi_dataset/channel-%d.csv", i), samples(:,:));
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.