0

(1) I was given a signal with the following criteria:

Samples: 349 Frequency: 3490 Frequency steps: 1 Last Trace: 4007

A data of a the signal contains 349 samples and the total data collected is 4007. Sampling frequency is described as the number of samples per second as described by googling. However for this signal, is the sampling frequency equals to 3490Hz or (349x3490)Hz?

(2) I was asked to conduct a Fourier Transform on this signal to determine the noises from this signal. This is the result that I attained from the code below:

clf;
a = importdata('A-scan.txt');
A = fft(a);
Aa = abs(A);
plot(Aa);
xlabel('frequency (bins)');
ylabel('magnitude');

Below is the result of the fft on the signal:

fft of signal

I have watched videos on youtube that the frequency is in bins. However, I am not entirely sure what it is. How do we determine the frequency of the signal and ultimately the noise of the signal in order for me to design a filter?

Paul R
  • 208,748
  • 37
  • 389
  • 560
hphys
  • 47
  • 6
  • Just read the MATLAB documentation on `fft`. It shows you exactly what you want to know, including examples. – Adriaan Apr 04 '18 at 06:35
  • See [this question](https://stackoverflow.com/a/4371627/253056) for an explanation of how FFT bins relate to frequency. – Paul R Apr 04 '18 at 07:35

1 Answers1

2

This is not a programming question, this is a math question.

That said, to convert bins to frequency:

f(k) ~= (k/(n/2)) * (fsam/2) for 0 <= k < n/2

It's only approximate because the precise formula depends on n being even or odd.

In your case n = 349, fsam = 3490Hz. The first peak seems to be at about k = 10, so your main component is at about frequency ~= 200 Hz.

Word of advice: if you need Google to find the explanation for "sampling frequency" you are in the wrong class. You need to learn Systems and Signals instead of Matlab.

Doctor Core
  • 102
  • 5
  • If this is not a programming question, please flag to close this question as "off-topic", and when you reach 50 reputation leave the OP a comment under the question explaining why you think it's off-topic. This also helps you, because off-topic questions get eventually closed and possibly deleted, along with the effort you put into the answer. – Adriaan Apr 04 '18 at 08:40
  • I am new to stackoverflow, literally making my first few answers today. I pointed out the facts, someone with the privilege and knowledge can finish the rest. It's a common problem for Matlab questions I get tons of them in my day job. – Doctor Core Apr 04 '18 at 11:10