Problem generating a randomized signal

조회 수: 1 (최근 30일)
Sarah
Sarah 2013년 2월 20일
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
Sarah
Sarah 2013년 2월 20일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Sarah
Sarah 2013년 2월 20일
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.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by