微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 天线设计和射频技术 > How to use Line spectral pairs in matlab?

How to use Line spectral pairs in matlab?

时间:04-07 整理:3721RD 点击:
Hi all
I am a new in matlab. I need to use line spectral pairs for my sensor signals. So, is there anyone who knows how to use it in matlab?
Any help appreciated. Thanks beforehand!

Hi sorry for not giving more details. Here are for you.
I am doing some research which is related signals. So I am using Accelerometer sensor and I was going to extract features from raw sensor data. So, I have been told that LSP is one of the good method for extracting good features from raw sensor data. That is way I was looking
some matlab code for this purpose. So could you help to me please?

Your descriptions can not be helpful for understanding what you want to do at all.
First of all, do you understand what you want to do and what you should do mathematically ?

Describe mathematically what you want to do.

Do you mean two tones extraction from noisy data by some spectrum estimation algorithm such as MEM, MUSIC, etc. ?

Spectral estimation - MATLAB
Spectrum Estimation

Hi, sorry for been a late with my description.
My project is not related to sound or speech. I am doing my research in human activity recognition area. So, accelerometer is used for analyzing human activities such as walking, jogging and standing. As we know, that all sensor data when it is as a raw format, it has a noise and it needs to be reprocessed before using. According to this purpose, I was looking some code for extracting good features from the raw sensor data. So, LSP is one of the good candidate for this purpose. However, i couldn't find any code for that.
I hope you can understand me. Thanks in advance for your next post.

There is no remarkable difference regarding signal processing even for your project.

I think simply you can't understand what you want to do mathematically.

Describe mathematically what you want to do.

Hi yes you are right, I can't understand it mathematically. According to this, I am asking a help from someone who knows it. I tried to find some files about LSP and I found only one paper and this paper also related to speech recognition. The code is shown in below:
function lsp=lpc_lsp(a)
p=length(a); A(1)=1; B(1)=1;
for k=2:p
A(k)=(a(k) - a(p+2-k)) + A(k-1);
B(k)=(a(k) + a(p+2-k)) - B(k-1);
end
r1=roots(A);
r2=roots(B);
for k=1:p-1
if (real(r1(k)) < 0)
theta1(k)=pi-abs(atan(imag(r1(k))/real(r1(k))));
else
theta1(k)=abs(atan(imag(r1(k))/real(r1(k))));
end
if (real(r2(k)) < 0)
theta2(k)=pi-abs(atan(imag(r2(k))/real(r2(k))));
else
theta2(k)=abs(atan(imag(r2(k))/real(r2(k))));
end
end
p=p-1;
for k=1:p/2
theta(k)=theta1(k*2);
theta(k+ round(p/2))=theta2(k*2);
end
lsp=sort(theta); %Sort into ascending order

This code was took from the following link : ScienceDirect - Signal Processing : Line spectral pairs

or it is shown the book which is named "Applied Speech and Audio Processing: With MATLAB Examples", 106-112 pages.
So, could you help to me to use this code or to explain it for me, please ?

As I expexted, what you want to do is "Spectrum Estimation".

MATLAB function, "lpc_lsp(a)", which you showed requires only one argument, "a".
So simply try to adopt your data for this function.

Line spectral pairs - Wikipedia, the free encyclopedia

Thanks for your help.
However, i have a question about the input argument 'a'? I have used my raw sensor data as a input 'a' argument. I think i have done mistake in that case. So, could you tell me whether i have done right or not ?
Thanks in advance.

"a" is a vector composed from data sequence.

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top