Re: Converting x-axis in terms of frequency
- From: "Dave Robinson" <dave.robinson@xxxxxxxxxxxxx>
- Date: Tue, 28 Feb 2006 12:06:51 -0500
Raj wrote:
I'm having difficulty converting my x-axis. I have converted the
complex
numbers of ffted data (X) to real values by applying the conjugate.
My new data is Z which has been ffted and where the hamming window
has aslo been applied.
I'm having difficulty labelling and converting my x-axis. I need to
represent it in frequency terms.
Data = Z
Sample rate = 44100Hz
Total no. of frequencies/values of data = 88200
Length of signal = 2 seconds
I have also applied fftshift to the data (Z) so that my left half
is
negative and the right half is positive.
How can I represent the x-axis in frequency terms?? I'm not sure
what
coding to use.
If someone could also tell me how I will be able to get rid of
certain
frequencies e.g. I want everything below 20Hz and -20Hz to be cut
off/throw it
away??
You remove the low frequency terms by applying a high pass filter to
your data. If you have the signal processing toolbox, you can design
one that suits your needs using the gui that Matlab provides. My
recommendations would be to design an FIR filter, then find its
transfer function by FFTing its impulse response which is defined by
the coefficients of the filter. Then simply multiply the FFT of your
signal by this transfer function. (Remember when you design this
filter to specify that the sample rate is the same as your sample
rate used to digitize your signal) If you feel adventurous you can
try and simply set the required frequency region to 0, however this
is very crude, and may lead to some unpleasant transient sounds, if
you actually listen to it, whereas designing a proper filter should
remove this problem.
Ok regarding the frequency axis. Your frequency resolution is defined
by the reciprocal of the period over which your data making up
spectra was taken over. If you are processing the complete 2 seconds
of data in one chunk, and not breaking it down into smaller packets,
your frequency resolution is 0.5Hz (1/2 secs). As you have done an
fftshift, then the first location in your array is -22050Hz (half
your sampling frequency), and increments up uniformly by 0.5Hz (thus
sample 2 will be 22049.5Hz) all the way up through 0 occurring at
sample 44100, and carrying on up to 22049.5Hz (it is always one slot
short of reaching 22050)
Hope that helps
Dave Robinson
.
- Follow-Ups:
- References:
- Converting x-axis in terms of frequency
- From: Raj
- Converting x-axis in terms of frequency
- Prev by Date: Re: binary data source in simulink
- Next by Date: Re: profiler: most of the total time was from Other lines & overhead
- Previous by thread: Converting x-axis in terms of frequency
- Next by thread: Re: Converting x-axis in terms of frequency
- Index(es):
Relevant Pages
|