help-octave
[Top][All Lists]

## Re: Questions regarding signal processing in octave

 From: Ahmed Husain ?Abbas Mohamed Sahrab Subject: Re: Questions regarding signal processing in octave Date: Thu, 10 Nov 2016 15:57:03 +0000

Sent: Thursday, November 10, 2016 2:44:30 PM
To: Ahmed Husain ?Abbas Mohamed Sahrab
Subject: Re: Questions regarding signal processing in octave

On Thu, Nov 10, 2016 at 6:19 AM, Ahmed Husain ?Abbas Mohamed Sahrab wrote:

We are a group of college students doing a project about signal processing.

We would like to compute the PSD(Power Spectral Density) and the Power Spectrum, our question is how to find the Power Spectrum and how to use different frame sizes e.g. 128, 256, 512.

We used this following code to find the PSD

NFFT=32768;

F=fft(y,NFFT);

F_Shift=fftshift(F);

Px=F_Shift.*conj(F_Shift)/(NFFT*L);

We tried using a NFFT of 1024 but we literally got two intersecting lines

Our Second question is about sine waves, we have a wave with the following specification

x = A1*sin(2*pi*f1*t)

Sampling Frequency = 100 kHz =Fs

Frequency = 10 kHz = F1

Amplitude = 0.1 = A1

We need to generate 1000 samples of this wave, we were given an equation which is
(fs=f*N) in which f is the frequency and N is the amount of samples needed. but in the question we already have the fs which is 100kHz so how are we supposed to generate 1000 samples?

Should we use
t= 0:ts: Tfinal
until we have 1000 values in the t variable?

Best Wishes

Students of Polytechnic Bahrain

_______________________________________________
Help-octave mailing list
https://lists.gnu.org/mailman/listinfo/help-octave

you said that
Sampling Frequency = 100 kHz =Fs

this is 100,000 samples in 1 second.
to get 1000 values you need 1000/100,000 seconds

Tfinal=1000/100000;

--
DAS