Code Monkey home page Code Monkey logo

white-noise-generation-'s Introduction

white-noise-generation-

This is based upon the white noise generation and narrow band through Matlab coding into mp3 file . %% write a code for white noise (1khz-16khz) and one narrow band sound (1khz-2khz)

low_f1 = 1000; % lower limit of the fq range high_f1 = 16000; % upper limit of the fq range fs = 33000; % sampling frequency time = 15; % in seconds len = 15; % in seconds

%% geberate a gaussian white signal n = round(time*fs); % number of samples x = randn(n ,1);

%% band pass the white noise to get the narrow band y = bandpass(x, [low_f1 high_f1],fs); [p, f] = pwelch(y, 1024, 768, 1024, fs);

%% read/generate sound f_sig1 = 1000; % lower limit of the fq range f_sig2 = 2000; % upper limit of the fq range t = linspace(0, len, fstime); % time Vector signal = sin(2pif_sig1t) + t.cos(2pif_sig2t) + 2sin(2pif_sig11.5*t);

% reading audio from sound_input.mp3 % [signal,fsig] = audioread('sound_input.mp3'); % reading signal

%% band pass the sound to get the narrow band sig_bp = bandpass(signal, [f_sig1 f_sig2],fs); [sig_nb, f_sig_nb] = pwelch(sig_bp, 1024, 768, 1024, fs);

%% plotting PSD subplot(2,1,1); plot(f, 10*log10(p))

subplot(2,1,2); plot(f_sig_nb, 10*log10(sig_nb))

%% write audio file - output.wav signal_final = y' + sig_bp(1:size(y,1)); sound(signal_final,fs) audiowrite('output.wav',signal_final,fs)

white-noise-generation-'s People

Contributors

kaushalacts avatar

Watchers

 avatar

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.