Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

very basic question on sampling frequency..need help

Not open for further replies.


Junior Member level 2
Oct 30, 2006
Reaction score
Trophy points
Activity points

Refer to following code, please tell me why we need sampling frequency 'fs', for our signal.

fs=250 % why need sampling frequency
y=wavread('m. wav')
Y= fft(y,N)
p= abs(Y)/(fs/2) % Why we divide here with ( fs/2), what this tells

please explain these questions , i need these basics informatio for my concepts.

best regards

actually the sampling frequency is not a constant and it depends on the bandwidth of the signal you are sampling....

let i have suppose this is my sampling frequency of the my signal .
how it depands ??

please try to clear it to me...........
please ans the related Questions on which i have marked ' %'


Sampling frquency must be double than the higest frequecny!

actually the sampling rate must a little more than double the signal bandwidth in order to reproduce the signal from its samples.... this is called nyquist criteria....

If it is less than souble it will produce intersymbol interference!

If it is much more than double .. we are not using proper resources provided to us\!

dear anand ;

please help me that what a difference b/w these two ststements

p= abs(Y)/(fs/2) % Why we divide here with ( fs/2), what this tells ??


p=abs(Y)/min(N ,fs)

plz help me...........................

best regards

if would post the full code then i would know what is being done... with just part of the code and without explanation of what p is used for it is hard to tell.....

dear anand

i only wants to know why we use fs in the above code, wht it tells us ??
and what this statement in the code tells us.........


y r u not geeing QUestion??? i think now you will understand it...

best regards

if i dont know what p is used for then how would i know why they have divided by 2....

p is the power...tryn to plot power spectral density i suppose...

p= abs(Y)/(fs/2) % Why we divide here with ( fs/2), what this tells ??

This statement means u r findin normalised power ...why (fs/2) because in fft we get the replica of positive freq on negative neglectin either one u r tryin to find total normalised power at each discrete frequency given by FFT....hEre major criteria u consider is u r readin wave file which could have a max samplin freq of 250 Hz.....


p=abs(Y)/min(N ,fs)

now in your above code u have taken N and fs independent of each other....usually we take N=fs/ it is obvious again u r findin same norm,alised power.....

and abs(Y) takes only real part into consider ...neglectin imaginary part for power calculation....N defines resolution....

If u find it useful please dont forget to press 'helped me' button...

Hi sohiltri.. could you tell me how we are normalising it... i still dont get you... what you meant by normalising... becoz... the maximum frequency in fft is (N-1)fs/N...does normalising the frequency means the value of freq will be from 0 to 1...

I am not normalizing freq...only power freq wil run from 0 to fs/2.....power need to be FFT we write 1/N(...)....but in matlab when fft taken it gives it real integer values ....

dear sohiltri
ur statements realy helped me.... i appretiate ur concepts....

now please if u could help in these two QUESTIONS:

1) i want backpropagation algorithm implemented in matlab. For the patter recognition.

2) in kaiser or in Equiripple filter , what is the diffreence between small 'n',

and capital" N".

3) please also show me in diagram (is possible), how we implement this formula
L=N-1 or L=M+N-1 in filter frequency response ( what and where is N ,L, andm) or formula derived

these are imp questions for me , so please i hope u could help me in these ...

best regards

Not open for further replies.

Part and Inventory Search

Welcome to