How to combine random noise signal into a specific audio signal from wav file? - matlab

(https://i.stack.imgur.com/r0Joi.jpg)
i have problem on how to combine these two signals to create a single noised audio signal

Related

Mutichannel Audio Output in Simulink

I'm using Simulink to output 2 sine waves through my audio output (headphones) 3.5mm jack. I want one of the sinusoids to be sent out Channel 1, and the other sinusoid sent out Channel 2.
I have tried using 2 sine wave blocks wired to 2 "To Audio Device" blocks, each with a different channel specified which gives the error 'A given audio device may only be opened once.'
I have tried wiring both sine blocks to a single "To Audio Device" block which do not connect.
I have tried using the Mux, Vector Concatenate and Matrix Concatenate blocks to combine the sinusoids before feeding the output into the To "Audio Device Block", which gave undesirable results.
I have got both sine waves working individually, but not both simultaneously.
Implement a custom function implementation in Simulink using components from the Data Acquisition toolbox. Here's an example of 5 channel output (5.1 channel sound system) - https://www.mathworks.com/help/daq/multichannel-audio-input-and-output-1.html#bt_9lng-5

How to listen to a 3x3 mixtured waves in matlab

I have a sound file (3x3_Mixture.wav)=sound33 which includes 3 different sound waves mixed with each other, I made a code to separate the 3 different sound waves by using fast-ICA and the natural gradient algorithm.
Now I want to listen to the file 3x3_Mixture.wav in matlab.
When I write sound(sound33) in the command window and then press enter I get the following error message: Only one- and two-channel audio supported.
How can I listen to 3x3_Mixture.wav in matlab when it has three sound waves, which command should I use?
When dealing with more than two channels in a wave file or vector there are basically a few options. The first one is downmixing the channels into one or two vectors. You could to so by summing over the channels or multiplying them with each other (element-wise multiplication, obviously).
Another one is to listen to the file by playing back the channels one by one or in pairs of two.
But if your audio hardware consists of more than two audio channels (simply-put an audio interface with >2 channels) my advise would be to use better tools than the included sound or soundsc commands of Matlab. Use for example Msound, a audio playback and recording tool utilizing the PortAudio framework to output up to 64 channels of audio to capable hardware.

what are the dimensions of audio in matlab?

What are the dimensions of audio just like a pictures has dimensions 3. 1 for rows, 1 for columns and 1 for layers.
I have recorded audio in matlab and converted it into an array through getaudiodata() it shows me number of rows = 4000 and number of columns =1
Audio has always been a 1-dimensional signal. Audio is stored on a computer due to the fact that we sample and quantize the audio input. Sampling refers to how often we grab an audio point to be stored in the file and quantizing refers to the resolution of each audio point itself. This is represented by a number of bits. Usually, this is either 8 or 16 bits.
However, you could have separate audio tracks for different channels. For example, stereo usually has left and right audio, and are represented as two individual audio tracks, but if you use audioread or getaudiodata, you'll get two columns. Each column represents either the left channel or the right channel. The number of rows tells you how many samples the audio signal consists of.
In general, each column represents an individual audio signal, but audio has always been a 1D signal. The independent dimension is time, while the dependent dimension is the amplitude or the intensity of the wave at a particular point in time.

Detect the start tone event for a race from a .wav file in MATLAB

I am trying to measure the duration (in samples) between a start tone (3800Hz) and finish tone (high amplitude but frequency unknown). The two tones are randomly distributed in a .wav file (est. 10 seconds). Is it important to identify the sample number of the last sample of the first tone and the first sample of the last tone? How can I do this?
The .wav file contains a fundamental frequency and some noise (as well as the start tone and finish tone). I have a prerecording of the start tone with the fundamental frequency and noise in the background, can i use a correlation function to detect it?
Some of the noise exceeds 3800Hz (instantaneously) so methods using threshold values for the detecting the tones don't work very well. However, can I use the fact that the tone event is longer in duration than any noise event (because it is made deliberately by pressing and releasing a button) to detect the tone.

Generating a sound using two channel in MATLAB

I am trying to create a sound using two channels. I send two signals with different frequencies.
I am trying to do it without the Data Acquisition Toolbox. It is possible to do it?
You could resample the two signal to the same sampling frequency, combine them as matrix columns, then create a WAVE file using the wavwrite function (or play the sound directly with soundsc)