# number of samples and Amplitude accuracy,what's the solution to this problem

I'm colleceting data samples from a device (temporal signal) in order to analyze it with FFT function in MATLAB R2015b,first i get N=4063 data points with (delta_t=0.000015s) so my frequency resolution is (delta_f=1/N*delta_t)=16.4Hz,this give me pretty good results with amplitude,but when i did another measurment with N=8192 data points (delta_t=0.000061) to obtain better resolution,the amplitude is not correct,i don't know really how to deal with this issue.so please if any body can help me with this i will be grateful,thank you

ps:i'm new in signal processing

below my code in MATLAB

sig_2=asp_ach_de1;
Fs2 = 1/0.000061;      % Sampling frequency
T2 = 1/Fs2;            % Sampling period
L2 = 8192;             % Length of signal
t2 = (0:L2-1)*T2;      % Time vector
% FFT FUNCTION
Y2 = fft(sig_2(:,2))
Q2 = abs(Y2/L2);
Q1 = Q2(1:L2/2+1);
Q1(2:end-1) = 2*Q1(2:end-1);
f2 = Fs2*(0:(L2/2))/L2; %FREQUENCY
figure(3)
plot(f2,Q1)


• Hiii! can you please also provide that asp_ach_de1 signal? or do you want us to predict it ? Commented Jan 21, 2019 at 16:55
• thank you Fat32,but how i'm suppose to share it with you here,it's 8192 line txt file or how to attach it. Commented Jan 22, 2019 at 5:43
• here's the 2 signals asp_ach_de1 "4k and 8k", gist.github.com/bishopreb85/19b056cfbea0d8c10e7ff1d0fa389d00 Commented Jan 23, 2019 at 8:48

I think that what is happening to u is that the frequency which you are trying to measure is in between 2 of your FFT bins which will cause the power to spread between two different indexes of your result FFT.

Another possible solution , only if with higher resolution you are getting a lower value , is that since as I understand this is a real signal with noise you may be summing more noise , on the first attempt, for each frequency of your FFT and as a result raising all the values of your FFT.

Without knowing the signal you are trying to process it is hard to know what is exactly the problem. also your FFT plots will help give a better answer.

• Thank you shaiel cohen,it's a Vibration temporal signal,i'm suppose to get an amplitude between 25 and 35,so you see my amplitude is not correct. Commented Jan 22, 2019 at 5:49
• Glad to help if you could provide the file and the graph of the 4k samples and the code for your first plot , that would help provide an answer. Commented Jan 22, 2019 at 6:09
• shaiel cohen,i tried to attach the file here but,i can't find any way to do it,so how you wanna from me to share with you the signal,can you suggest for me Commented Jan 22, 2019 at 19:00
• Upload to a gist on git will probably be the most useful Commented Jan 22, 2019 at 19:40
• I'm really sorry,i don't think that i understand you with "git" or how to use it,i have only a txt file if you want i'll send it to you, Commented Jan 22, 2019 at 19:51