0

Im new to matlab and as part of my university assignment,im supposed to draw up these signals on matlab.and i have some problems regarding the units of the psd plots.

1)j=0:1/100:1; %time index
z=sin(2*pi*5*j); %sine wave signal
z=z*2;
plot(z),xlabel('Sampling Points'),ylabe;('Amplitude');
figure,psd(z)

2)noise=rand(1,100);
plot(noise);
figure,psd(noise);

3)[B,A]=butter(10,3/50,'low');
LPFz=filtfilt(B,A,z);
plot(LPFz)
figure,psd(LPFz)

4)y=wavread('sp1.wav');

Fs=44100; %sampling frequency
wavplay(y,Fs);

save sp1.mat y
plot(y(:,1)),title('Waveform of Speech'),xlabel('Sample Points'),ylabel('Amplitude')
figure,psd(y(:,1))

i would be extremely grateful to anyone who can help my by telling me the units i should use for the x axis of the psd spectrum,y axis is in dB ,that i got.i dont know what to out for x

1 Answers1

0

If you are looking at your first example the x coordinate of plot (z) should be time. After all you define j as a time index and generate your z-function to be a function z(t).

If I am not mistaken your z function is a sine of structure 2*pi*omega*time with omega beeing a constant (5).

If u have further information about that constant you can be more specific about your x-axis.

As a matter of fact you can just look at your function: exponents as well as triangular functions (sine, cosine ,etc) have to be without dimension (seconds, meters ,kg, and so on)

If you were wondering about the units for the psd function, it is a spectrum. This means the x-axis is a frequency domain(1/seconds = 1Hz). In Matlab 8.2 it is recommended to use spectrum(z) instead of psd(z)

The Minion
  • 1,164
  • 7
  • 16