Problem generating a randomized signal

1 Ansicht (letzte 30 Tage)
Sarah
Sarah am 20 Feb. 2013
I want to create a zero baseline signal that extends for some time t. Throughout the duration of this signal, I would like to have 3000 randomized sinusoidal excitations. By randomized, I mean in terms of frequency, amplitude, width, and location of the event.
I'm not exactly sure how to create this. I created three randomized vectors using the rand function, one for abnormal amplitude, frequency, and width. However, I'm not sure how to specify the randomized location of each excitation. I have the following code so far:
clear all; clc;
addpath(genpath(pwd));
Fsam = 1000; %Sampling Frequency
YNo = 10; %Number of years
ENo = 3000; %Number of abnormal excitations
%Abnormal Signal Parameters
%%%%%%%%%%
This generates a randomized vector for Amplitude, Frequency, and Width of the abnormal excitations. The randomized values are rounded to the nearest integer
%%%%%%%%%%
a = 0;
b = 10;
Rand.AbAmp = a + (b-a).*rand(1,ENo);
Rand.AbFreq = a + (b-a).*rand(1,ENo);
Rand.AbWid = a + (b-a).*rand(1,ENo);
Rand.AbAmp = round(Rand.AbAmp);
Rand.AbFreq = round(Rand.AbFreq);
Rand.AbWid = round(Rand.AbWid);
%Time Parameters
T.Start = 0; %Time Start
T.End = 365*YNo; %Time End (years)
T.Step = 1/Fsam; %Sampling rate
Time.Ref = T.Start:T.Step:T.End; %Time
%Abnormal Signal Creation
Sig1 = Ab.Amp*sin(Ab.Freq*2*pi*Ab.Time + Ab.Phase);
Thanks for your help!
  1 Kommentar
Sarah
Sarah am 20 Feb. 2013
Here is an example of the signal I would like to create:
Here, I created three sinusoidal excitations. I specified the amplitude, frequency, location, and width of each excitation. However, I would like the amplitude, frequency, and width of the sinusoidal excitations to be random. Also, I would like the location to be random. I would like 3000 events. I'm not sure how to create the entire signal...so that is what I need help with. I hope this makes things more clear.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Sarah
Sarah am 20 Feb. 2013
Here is an example of the signal I would like to create:
Here, I created three sinusoidal excitations. I specified the amplitude, frequency, location, and width of each excitation. However, I would like the amplitude, frequency, and width of the sinusoidal excitations to be random. Also, I would like the location to be random. I would like 3000 events. I'm not sure how to create the entire signal...so that is what I need help with. I hope this makes things more clear.

Kategorien

Mehr zu Creating and Concatenating Matrices 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!

Translated by