Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet


Discussion Groups

Discussion Groups | Matlab DSP | generating waveforms

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

generating waveforms - nobox2003 - May 14 8:41:39 2007



hi guys I'm very new to Matlab and DSP and am in a bit a nitch.I need 
to generate waveforms of 512 samples centred on sample  200 andI also 
need to normalise the amplitude of each waveform to give it unity area
The wave forms are:
1. rectangular  and triangulr pulses with 45 samples wide
2. Gaussian with st of 13.5
and a hamming window at N=66

really struggling with this one problem in particular but on the whole 
the whole matlab thing is quite easy and quite understandable.
Would reall appreciate your help on this as soon as possible
Thanx
noxolo


(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: generating waveforms - will...@sygnvs.com - May 16 10:09:45 2007

Hi Noxolo,

I don't exactly understand what you are trying to do, can you clarify what you mean by
"generating 512 samples centered on sample 200"?  The following code is for what I
think you are trying to do:

%vector x for square waveform

x = zeros(1,512);
x(178:222) = ones(1,45);

%vector y for triangle waveform

y = zeros(1,512);
y(178:222) = conv(ones(1,22),ones(1,22))/2;
I also don't understand what you mean by "Gaussian with st of 13".  If you are
looking for a sample function of a random variable with Gaussian distribution, the function
"randn" will do that.  If you need white Gaussian noise, the Communications Toolbox
comes with the function "awgn".  Also for the hamming window, if you have the DSP
toolbox there is a function that I think is called "hamming" that will let you design
the window.  "fdatool" also has it, I believe

Good luck,
Wil
http://wilperkins.com

hi guys I'm very new to Matlab and DSP and am in a bit a nitch.I need 
>to generate waveforms of 512 samples centred on sample  200 andI also 
>need to normalise the amplitude of each waveform to give it unity area
>The wave forms are:
>1. rectangular  and triangulr pulses with 45 samples wide
>2. Gaussian with st of 13.5
>and a hamming window at N=66
>
>really struggling with this one problem in particular but on the whole 
>the whole matlab thing is quite easy and quite understandable.
>Would reall appreciate your help on this as soon as possible
>Thanx
>noxolo
>



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )