noise

How to generate noise using specific variance

谁说我不能喝 提交于 2019-12-20 07:48:33
问题 In the matlab function awgn() that is used to add noise to a signal, is there a way specify the variance? In general, I would have simply done noisevec = sqrt(2)*randn(length(X),1); creates a noise vector of variance 2. Then the noisy observations are Y = X+noisevec But, I would like to apply awgn() and then check if the variance of noise is indeed as specified by the user. How to do that? % add noise to produce % an SNR of 10dB, use: X = sin(0:pi/8:6*pi); Y = awgn(X,10,'measured'); UPDATE :

Solid Noise Generation in C++

浪子不回头ぞ 提交于 2019-12-18 18:39:44
问题 So I have been using my Google'ing skills to study Perlin and Simplex noise, and have come across a lot of articles that are a bit math heavy for myself. I've also come across a lot of code, but it seems to be either in C# or Java, neither of which I am familiar enough to be able to extrapolate how the noise is actually generated. My goal is to find some code that will generate solid noise, similar to the "Render Clouds" function in GIMP, as shown below: Now it doesn't have to be anything

Add noise effect to a drawing

寵の児 提交于 2019-12-18 18:20:53
问题 I'm in the process of creating a custom view for my android application and would like to add a noise overlay over my drawings. My drawings are pretty standard, arcs, bezier curves, etc. What would be the way to go with creating a noise overlay over arbitrary shapes, drawn with canvas? 回答1: Use a tileable transparent noise png and cover the canvas with it. 来源: https://stackoverflow.com/questions/6994289/add-noise-effect-to-a-drawing

Matlab: Generate noisy signal for particular SNR and particular variance

本秂侑毒 提交于 2019-12-18 09:48:03
问题 In general when we add noise to a signal x=rand(1,100) , this is one way sigma_2_v = 0.5; noisy_signal = rand(1,100) + sqrt(sigma_2_v)*randn(1,100); There is another method found here: Proper way to add noise For my case, I need to have the information about the variance of the noise, sigma_2_v , and generate noisy signal by varying sigma_2_v . How can I do that? 回答1: There are a number of possible conventions used to define a s/n ratio, a common one being based on the notion of signal and

Determine frequency from signal data in MATLAB

一世执手 提交于 2019-12-17 15:46:29
问题 I have data from a sensor and I need to find the frequency of it. It looks like fft() seems to be the way to go, but the MATLAB docs only show how to get a graph of the frequencies, I don't know what to do from there. Here's what my data looks like: 回答1: One way to go is indeed to use an fft. Since the fft gives you the frequency representation of the signal, you want to look for the maximum, and since the fft is a complex signal, you will want to take the absolute value first. The index will

Processing Particle

放肆的年华 提交于 2019-12-13 05:51:36
问题 I've been trying to do something with this project I have but failed always so far :) so decided to ask here :) I want the particles to go around the ellipse from Rock class, not through it but around it, like a rock inside a river that water flows around it. Any suggestions ? int NUM_PARTICLES = 1000; ParticleSystem p; Rock r; void setup() { smooth(); fullScreen(P2D); //size(700,700,P2D); //background(0); p = new ParticleSystem(); r = new Rock(); } void draw() { background(0); p.update(); p

Deconvolution with R (decon and deamer package)

旧街凉风 提交于 2019-12-12 09:10:02
问题 I have a model of the form: y = x + noise. I know the distribution of 'y' and of the noise and would like to have the distribution of 'x'. So I tried to deconvolve the distributions with R. I found 2 packages (decon and deamer) and I thought both methods should make more or less the same but I don't understand why deconvoluting with DeconPdf gives me a something like a normal distribution and deconvoluting with deamerKE gives me a uniform distribution. Here is an example code: library

OpenCV: Denoising image / video frame

≡放荡痞女 提交于 2019-12-11 11:25:14
问题 I want to denoise a video using OpenCV and C++. I found on the OpenCV doc site this: fastNlMeansDenoising(contourImage,contourImage2); Every time a new frame is loaded, my program should denoise the current frame (contourImage) and write it to contourImage2. But if I run the code, it returns 0 and exits. What am I doing wrong or is there an alternative way to denoise an image? (It should be fast, because I am processing a video) 回答1: while you are using c++ you are not providing the full

Add random noise with specific SNR to a signal

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 06:34:11
问题 I have randomly generated signal for example: %frequency f1 = 1000; f2 = 2000; Fs = 8000; %sampling frequency %amplitudes amp1 = 0.75; amp2 = 0.2; %time dt = 1/Fs stopTime = 0.3; t = 0:dt:stopTime; %random noise noise = randn(1,length(t)) %generated signal Signal = amp1*sin(2*pi*f1*t) + amp2*sin(2*pi*f1*t) + noise; Now i need to create two Signals S1, S2 with random noise with specific SNR. Noise added to S1 must be uncorrelated with noise added to S2 Here is what i tried: %SNR in dB SNR = [

Create pink noise image in Matlab

℡╲_俬逩灬. 提交于 2019-12-11 03:58:09
问题 I'd like to generate a 2D image of arbitrary size containing randomly generated pink noise. Wikipedia suggests that the 2D generalization of pink noise will have energy that falls off as 1/f^2. I found some code on the MATLAB File Exchange that computes a 1D pink noise vector. But I don't know how to properly generalize it to two dimensions -- I'm not very familiar with the fft, and my naive attempt below produces complex vectors when I compute the ifft. function pink = pinkNoiseImage(nrow