generate Pseudo-Noise sequence in matlab [duplicate] - matlab

This question already has answers here:
How to generate noise using specific variance
(1 answer)
Matlab: Generate noisy signal for particular SNR and particular variance
(1 answer)
Proper way to add noise to signal
(4 answers)
Closed 3 years ago.
I have question about adding Pseudo-Noise sequence.
How can I add PN-sequence as a matrix or a vector with specific size?

Related

plotting deviation along all the values of x? [duplicate]

This question already has answers here:
xaxis/yaxis lines in matlab plot
(2 answers)
How to add a x-axis line to a figure? (matlab)
(6 answers)
Closed 3 months ago.
I want to plot the mean of a data measurement with the standard deviation along the x-axes. I tried using boundedline, but it is not working. I have just one value (y value) with the corresponding standard error to plot across the x values. Can someone know how to do it?
boundedline.m - File Exchange - MATLAB Central (mathworks.com)

How can I apply a filter (high-pass) to a wav file in matlab [duplicate]

This question already has answers here:
How to apply a low-pass or high-pass filter to an array in Matlab?
(2 answers)
High-pass filtering in MATLAB
(3 answers)
Closed 5 years ago.
I have a few second length sound clip (.wav) and need to apply a high-pass filter to see the high frequency components of that.
AI=analoginput('winsound');
addchannel(AI,1);
set(AI, 'SampleRate', 8000);
set(AI, 'SamplesPerTrigger', 32000);
start(AI);
data=getdata(AI);
wavwrite(data,'audio.wav');

Plot two discrete points in 3-D space [duplicate]

This question already has answers here:
plot a 3d point in MatLab
(2 answers)
Closed 7 years ago.
How can I plot these two 3-D points in Matlab?
P=[0.8061302526383115, 0.8122242071197412, 0.7836563734015345]
and
Q=[0.80612997, 0.81221923, 0.78366043]
Have a look here: https://www.mathworks.com/help/matlab/ref/scatter3.html
You can do:
scatter3([P(1),Q(2)],[P(2),Q(2)],[P(3),Q(3)])

Bandpass filter in matlab [duplicate]

This question already has an answer here:
Remove noise from wav file, MATLAB
(1 answer)
Closed 7 years ago.
I have a audio file I want to filter it so that i can just have frequency within certain range. I just want signal from 12Khz to 14Khz I want to filter out the other frequency. I tried the butterworth filter in matlab but i dont seem to understand the parameter.
Have you try:
[y,fs]=audioread('audio.audioformat');
wn=[12000 14000]/(fs/2);
[b,a]=butter(n_order,wn);
f=filter(b,a,y);
And we divide wn by (fs/2) because the butter command only accept a
normalized Frequency

Histogram normalise figure output [duplicate]

This question already has an answer here:
Centering histogram bins and setting percentage range in Matlab
(1 answer)
Closed 9 years ago.
I have a big matrix with thousands of values. I want to make a histogram of each signal. This is easily done with MALTAB's commands. My problem is I want it normalised in the sense that the y-axis is 0-1 and not 0-(the number of measurements). Any smart way to do this?
Use histc()
counts = histc(data);
normCounts = counts/sum(counts);