.how to find the Fourier transform of a continuous Signal (audio) With its samples ?

1 view (last 30 days)
Hi All,
I need to write a function that evaluates the Fourier samples of a "Continuous-Domain" signal at the frequencies given in "Freq_vector".
"audio_vector" encapsulates the samples of this continuous-domain signal captured with the sampling rate "Fs".
result = Fourier_Samples(Freq_vector , audio_vector , Fs
We have 3 inputs for this function:
  1. "Freq_vector" is a vector of frequency values in Hz at which the Fourier samples are desired.
  2. "audio_vector" is the vector of samples of an audio signal.
  3. "Fs" is the sampling frequency (HZ) which is used for sampling the audio signal.
How can I do it?

Answers (1)

Image Analyst
Image Analyst on 27 Dec 2013
You need to make a function. This can be a separate m-file called Fourier_Samples.m or it can be in the same file as your calling routine as long as the calling routine is a function also, not a script. Like
function test()
result = Fourier_Samples(Freq_vector , audio_vector , Fs)
% Now declare the function:
function result = Fourier_Samples(Freq_vector , audio_vector , Fs)
% Your code goes here.
I don't know what a "Continuous-Domain" signal is - presumably your instructor means " time domain signal", which is also not continuous because everything in computers is quantized/digitized.
  2 Comments
vajihe
vajihe on 27 Dec 2013
Thanks.You are right. my input is a sound file so it is time domain.I want to make function with input of samples of this input(captured in Fs) my problem is That I don't know What should be the code! could you help me? means I Want to know what should be written in the place" % Your code goes here."
Image Analyst
Image Analyst on 27 Dec 2013
That's where you do your homework. Obviously it will involve calling fft(audio_vector) and then plucking out the elements at frequencies specified by Freq_vector. I don't think I can do more without doing 100% of your homework for you.

Sign in to comment.

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!