![0000 Screenshot.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/256875/0000%20Screenshot.png)
To synthesize two irregular waves ??
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kang Min Kim
am 23 Dez. 2019
Beantwortet: Image Analyst
am 23 Dez. 2019
![선2.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/256829/%EC%84%A02.png)
like the picture above
I'd like to synthesize two irregular waves.
What code should I use as a matlab to do that?
My english is not good sorry
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 23 Dez. 2019
Try this:
% Make noise-free signal.
period = 40;
amplitude = 5;
x = linspace(0, 40, 500);
y = amplitude * sin(2 * pi * x / period);
plot(x, y, 'b-', 'LineWidth', 2);
grid on;
fontSize = 20;
xlabel('x', 'FontSize', fontSize);
ylabel('y', 'FontSize', fontSize);
% Make a noisy signal
noiseAmplitude = 60;
noise = noiseAmplitude * rand(size(y)) - noiseAmplitude/2;
% Blur the noise to make it smoother.
noise = movmean(noise, 80);
noisyy = y + noise;
hold on;
plot(x, noisyy, 'r-', 'LineWidth', 2);
% Compute the sum
ySum = y + noisyy;
darkGreen = [0, 0.5, 0];
plot(x, ySum, '-', 'Color', darkGreen, 'LineWidth', 2);
legend('y1', 'y2', 'y1+y2');
![0000 Screenshot.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/256875/0000%20Screenshot.png)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Parametric Spectral Estimation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!