help me to write a code for processing an audio signal using taylor series

1 次查看(过去 30 天)
clc;
clear all;
[x,Fs] = audioread('audioe.wav');
sound(x,Fs);
whos x
disp(Fs)
x = x(:,1);
dt = 1/Fs;
t = 0:dt:(length(x)*dt)-dt;
figure(1)
plot(t,x); xlabel('Seconds'); ylabel('Amplitude');
h = spectrum.periodogram; % create a periodogram spectral estimator.
figure(2)
psd(h,x,'Fs',Fs); % Calculates and plots the two-sided PSD.
%plot(psd(spectrum.periodogram,x,'Fs',Fs,'NFFT',length(x)));
y = interp(x,4);%resample data at a higher rate using lowpass interpolation
%[y, ty] = resample(x,t,Fs);
%y =resample(x,3,2);
figure(3)
subplot(211);
stem(x);
title('Original Signal');
subplot(212);
stem(y);
title('Interpolated Signal');
SNR = snr(x);
SNR1 = snr(y);
a=2;
N =2;
z = taylor(x,a,N);
plot(z);
  3 个评论
Elavarasi E
Elavarasi E 2019-9-20
i need to sum up three different dimensions, which is in taylor series. this is in matrix and the equation is :
(x+h) = x + (h.*diff(x)) + (h^2.*diff(x,2))./factorial(2);
(x+h) is of same length of 'x' while first derivative is one lessthan 'x' and second derivative is of two lessthan of 'x'.
Elavarasi E
Elavarasi E 2019-9-28
In an audio signal, I need to find the intermediate samples. To read the intermediate I make use of taylor series. Audio signal is read thro’ [x,Fs] = audioread('audioe.wav');
The taylor series am using is f(x+h) = f(x) + hf’(x) + h2f’’(x)/2! .
Were f(x) is ‘x’ . Accordingly f(x+h) should be x(t)+h but this doesn’t work. ‘h’ is some intermediate value.
clc;
close all;
clear all;
[x,Fs] = audioread('audioe.wav');
sound(x,Fs);
whos x
disp(Fs)
x= x(:,1);
dt = 1/Fs;
t = 0:dt:(length(x)*dt)-dt;
figure(1)
plot(t,x);
xlabel('Seconds');
ylabel('Amplitude');
dx = gradient(x);
dx2 = gradient(dx);
for t = 0:dt:(length(x)/4*dt)-dt
for x = 0:dt:(length(x)/4*dt)-dt
h = 0.347;
y(t+h) = x + (h.*dx) + (h^2.*dx2)./factorial(2);
end
end
figure(2)
% hold on
plot(t,x,'blue',t,y, 'red')
% hold off
legend('actual','taylorseries')
for loop doesnt work

请先登录,再进行评论。

采纳的回答

darova
darova 2019-9-20
Try gradient instead of diff
dx = gradient(x);
dx2 = gradient(dx);
result = x + (h.*dx) + (h^2.*dx2)./factorial(2);
  21 个评论
Elavarasi E
Elavarasi E 2019-10-23
hi !
let 'n' be a sequence. it should be broken down into samples of length 1024.
i.e n/1024 = y spectrum.
i should plot this 'y' spectrum as overlapped spectrums with an overlap of 48 samples on each spectrum. the last spectrum can be padded with zeroes at the last.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Signal Generation and Preprocessing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by