Mostrando postagens com marcador digital signal processing. Mostrar todas as postagens
Mostrando postagens com marcador digital signal processing. Mostrar todas as postagens

quarta-feira, 14 de novembro de 2012

Análise de dados com Pentaho

Esta semana eu conheci o Pentaho, um pacote de software, com uma versão livre e outra enterprise, completo para análise de dados.

O objetivo de sistemas como o Pentaho é fornecer toda a infraestrutura de software para armazenamento, cruzamento, filtragem, análise e processamento (matemático e estatístico) e visualização de dados com a finalidade de suportar tomadas de decisão por parte de gestores.

Os principais benefícios deste tipo de sistema é a capacidade de identificação de padrões e tendências em bases de dados e a possibilidade de se fazer predições fundamentadas nos dados já armazenados, como previsão de demandas, de crescimento, de lucro, de risco, etc... além de permitir também a identificação de padrões como perfis de clientes/usuários, padrões de comportamento (humano ou de um ambiente), potencial de fraude em processos ou transações, etc....

Já escrevi alguns posts sobre as técnicas de análise estatística utilizadas neste tipo de sistema:
Mas sei que os textos contidos neste blog sobre esse assunto deixam muito a desejar.

Assim, acho que vale citar dois artigos no portal IBM DeveloperWorks acerca de análise de dados, porém utilizando o software de análise estatística SPSS Modeler:


segunda-feira, 26 de outubro de 2009

Convolution - Scilab

Hi David, I read your comment.
I didn't understand what you'd like to say.

I have another blog about Scilab, and I made some posts about convolution (here).
I wrote something about the convolotion's properties there, I think you'll be satisfied.

If you need any help more, I can try to do it.

Ok, that's all.

God bless you, my friend.

quinta-feira, 19 de março de 2009

Mathematical Morphology using OpenCV

I did a post about mathematical morphology, I wrote about theory of mathematical morphology.

Now, I want to write about the functions of OpenCV* for manipulate the structural element and apply the operations of erosion and dilatation.

The following function creates the structural element:

IplConvKernel* cvCreateStructuringElementEx( int cols,
int rows,
int anchor_x,
int anchor_y,
int shape,
int* values=NULL );

cols: Number of columns of the structural element

rows: Number of rows of the structural element

anchor_x: Horizontal offset relative to point of anchor, normally equal to 0 (zero)

anchor_y: Vertical offset relative to point of anchor, normally equal to 0 (zero)

shape: Type of structural element, possible values:
  • CV_SHAPE_RECT, square element;
  • CV_SHAPE_CROSS, element in disc;
  • CV_SHAPE_ELLIPSE, elliptic element;
  • CV_SHAPE_CUSTOM, element defined by user. In this case, the parameter values specifies the mask, delimiting the vicinity of the pixel in analysis.
values: Pointer to structural element defined by usuer, this parameter is used just for shape = CV_SHAPE_CUSTOM.

Function of erosion:

void cvErode( const CvArr* src, CvArr* dst,
IplConvKernel* element=NULL, int iterations=1 );

Function of dilatation:

void cvDilate( const CvArr* src, CvArr* dst,
IplConvKernel* element=NULL, int iterations=1 );

src: Input image;
dst: Output image;
element: Structural element. If it's NULL, the structural element is a square 3x3;
iterations: Number of times for apply the operation.
The interfaces for development in Python is the same, and all functions are very fast because they're implemented in C.

More informations here.


----------------------
* OpenCV (Open Computational Vision) is a API for development using Computational Vision. It's a very powerful set of functions for capture, processing and showing of images and videos.

segunda-feira, 2 de março de 2009

Convolution

What's convolution? Who studies functional analysis in mathematics or signal and/or image processing, they ask themselves: "what's convolution?" and now we'll try to show a light.

Give a generic function f(t), for example a signal of voice.

We want to analyze the similarity between f(t) and another function h(t) (known). The similarity should be calculated for all t, because we don't know the moment that f(t) is most similar to h(t).

Okay, now we know what we have to do, let's learn how we do.

We have a function f(t), the most similar function to f(t) is f(t) (obvious), so if we dislocate f(t) over itself, for each lag (t - s) we calculate the similarity between f(t) and f(t - s), the maximum similarity occurs for s = 0.

But, if we have the function f(t - a) (f(t) shifted to left of a), thus if we dislocate h(t) = f(t - a) over f(t) the similarity between f(t) and f(t - s), the maximum similarity occurs for s = -a.

If we have a function h(t) and we don't know the moments and the values of similarity between f(t) and h(t), then we need calculate the similarity for each t, and I say: this calculus is the convolution.

For finish, Why do we want to calculate the similarity between two functions?

Because we can find known patterns in given functions. Return to signal of voice, we can find phonemes (known patterns) over a captured signal.

--------------
The command in Scilab that calculates the convolution is convol().

quinta-feira, 5 de fevereiro de 2009

Neural learning

Let's talk about neural computation.

The algorithms of neural computation are based in observations of nature, specially in animal's nervous system.

I did a post (here - in Portuguese) about neural networks, I wrote about concepts for who wants develop the algorithms.

The neural algorithms are able to assimilate the information by itself, like us.

The computers hold the information in digital memory and access the information by memory addresses, if we need an information then we send the address and get the content. In neural systems, if we need an information then we send a correlated information.

Let's think. You can't enumerate your neurons and access the information one by one. But you can access the information in your brain using other information correlated to it, for example: dog. You thought in a dog conforms to the standards you know.

Other example:
You look the image and you think the words garden, flowers, plants and the emotions like peace, tranquility, etc...

To finish, remember that God created the perfect nature, we can contemplate the nature and seek inspiration in God's creations.

quinta-feira, 15 de janeiro de 2009

Blog about Scilab

I created a new blog just about Scilab.

I want to teach how to use the Scilab for English speakers.

I'll post codes and tips for developing in Scilab and Scicos.

I want to teach something about digital images and signals processing in the new blog, but I'd like receive comments and interactions (votes in polls, for example) in the blog.

If I receive comments and suggestions, then I'll do posts as you want.

So, it's all! Visit me here, too.

terça-feira, 6 de janeiro de 2009

I'm back

I will travel today and my return is next Monday. I will start a tutorial about Scilab, I'm thinking in create a new blog over the English version of the Scilab tutorial.

I'd like that the readers comment this post with suggestions about examples areas like digital signal and image processing, computational intelligence, automation and control, etc...

I will use the suggestions on the Scilab's codes that I will develop.

I created a new blog (all in English). I'd like to receive visits on my new blog.

sábado, 8 de novembro de 2008

Fuzzy Logic

The fuzzy logic is a generalization of classic sets theory.

In the classic sets theory, a element is in a set or not.

For example, the fruit's universe, the orange is in set of citric fruits, and the apple is not in that set.

But, if we analyze the people's universe and make 2 sets: rich people and poor people. If anyone has more than US$ 500,000.00, that's rich, if anyone has less than US$ 500,000.00, that's poor.

Thus, someone has US$10,000.00; US$30,000.00; US$50,000.00; US$70,000.00; US$100,000.00; US$120,000.00; US$180,000.00; US$210,000.00; US$220,000.00; US$300,000.00; US$450,000.00; US$480,000.00; US$492,000.00; US$497,000.00; US$499,800.00; US$499,930.00; US$499,981.00; US$499,996.00; US$499,999.20; US$499,999.98; that's a poor people. And other someone has US$1,000,000.00; US$980,000.00; US$840,000.00; US$770,000.00; US$680,000.00; US$610,000.00; US$590,000.00; US$540,000.00; US$510,000.00; US$508,000.00; US$502,000.00; US$501,000.00; US$500,100.00; US$500,010.00; US$500,001.00; US$500,000.10; that's a rich people.

But, let's think: if anyone has US$499,999.97 and other one has US$500,000.01 they have the same money, because US$0.04 is almost no money, but they aren't in same set.

The fuzzy logic add the pertinence concept for each element. So, all elements are in all sets, but each element has a specific pertinence in each set.

We can use fuzzy logic in any situation, solving it as a linguistic problem. If you need classify the cars in big or small, is possible do 2 fuzzy sets, if you need classify the cars in big, small and median, is possible do 3 fuzzy sets, and successively.

I did the following video of a application that I developed for A.I. class.



Any question, you can comment the post.

segunda-feira, 27 de outubro de 2008

Genetic Algorithms

I'll talk about Genetic Algorithms at this post.

Genetics Algorithms (G. A.) are a type of evolutionary computation, wich the software "upgrade itself" for solve a problem.

The principle of G. A. is the Theory of Evolution (Biology).

In terms of system's engineering, we use G. A. with 4 steps:
  1. Identify the problem and make it solution as a vector of numbers (preferentially, binary numbers);
  2. Generate a lot of possible solutions (population), without think "what's the best solution for my problem?" (the software will find a good solution);
  3. Create a measure for the solutions (G(.)), this measure indicates the "solution's adaptability" (for each solution);
  4. Cross the solutions until a satisfiable solution is find.

Observations:
  • The more adaptable solutions have more probability of cross with others solution.
  • The function G(.) is higher as better is the solution for solve the problem.
  • The cross between 2 solutions occurs with a changing of some numbers of the vectors.
  • The worst solutions are discarded and the new solutions just be better than the old solutions.

A example: give a room with N lamps, which lamps should be lit for best lighting and less power consume?

{Making N = 10}

Each possible solution is a 10 positions vector: s = [l0 l1 l2 l3 l4 l5 l6 l7 l8 l9] which s[i] indicates the status of i-st lamp (s[i] = 1 -> lamp on, s[i] = 0 -> lamp off).

Creating a population of solutions:
s1 = [0 1 1 0 0 0 1 1 1 1]
s2 = [0 1 0 0 1 1 0 1 1 0]
s3 = [1 1 0 1 1 0 0 0 1 0]
s4 = [0 0 0 0 1 1 1 1 1 0]

(Of course that's very few solutions.)

Let's suppose that:
G(s1) = 18%
G(s2) = 32%
G(s3) = 35%
G(s4) = 15%

(The developer invents the G(.) according the problem.)

Thus, in this case, the result of G(.) is the probability of each solution cross with other solution.
(Is not possible make a "self-cross")

One very possible crossing is {s1, s3}.
s1= [0 1 1 0 0 0 1 1 1 1] and s3 = [1 1 0 1 1 0 0 0 1 0]

Determine a random point in the vector (for example 6) and change the numbers.
The cross' result:
s1' = [s1[0] s1[1] s1[2] s1[3] s1[4] s1[5] s3[6] s3[7] s3[8] s3[9]]
s1' = [0 1 1 0 0 0 0 0 1 0]
s2' = [s3[0] s3[1] s3[2] s3[3] s3[4] s3[5] s1[6] s1[7] s1[8] s1[9]]
s2' = [1 1 0 1 1 0 1 1 1 1]

So, the function G(.) is used in all new solutions, and the cross occurs until find a good solution.

I explained a simple form of develop a genetic algorithm, but the algorithm's complexity can be higher if you use many points in the cross, non-binaries vectors or insert mutation in the algorithm (if the algorithm don't result to good solutions).

Now, let's play with the Genetic Algorithms.

segunda-feira, 22 de setembro de 2008

terça-feira, 16 de setembro de 2008

GPIB - General Purpose Interface Bus

GPIB (General Purpose Interface Bus) is a communication interface between diferents devices, as USB, serial port, parallel port, etc....

The National Instrument$ and Angilent ($$$) support this interface (developing drivers and aplications), this is the first and problably the last post that I do about anything that use proprietary software, I want only show that is possible use free software in this type of situation.

So, the GPIB was developed by cientists, for your devices, and they earn rates about 5MB/s (yes, 5 Mega Bytes). Few time later the IEEE maked the standard IEEE-488.

This standard is very commom is devices of materials analysis, radio-frequency, etc.... those are used in "down engeneering".

But the Scilab has a toolbox for GPIB systems (here) and it works on GNU/Linux (if the toolbox doesn't work on GNU/Linux I don't make this post)!

About the GPIB:
  • Supports until 32 devices simultaneously;
  • In a GPIB network exists 3 types of elements: talkers, listeners and controllers;
  • Each device can be acessed and controlled individually.
For GNU/Linux developers, exists free libraries for GPIB developing to C/C++ and Python languages.

I'm having sucess with Scilab and GPIB.

Finishing: we don't need use MetLab or LambVIEW or any proprietary software (they smell badly!).

domingo, 24 de agosto de 2008

Fourier Transform

The Fourier Transform of x(t), a continuos signal, enables the analysis in frequency of this signal.

The signal x(t) represents a value in each time instant, the signal X(jw), Fourier Transform of x(t), represents a value for each frequency, for example:

x(t) = cos(2t), X(jw) = 0.5 to w = 2 and w = -2, in this case x(t) has only frequency in 2 and -2 radians/s.

The Fourier Transform is defined by:

We observe the operation and see that X(jw) is obtain from a superposition of exp(-jwt) over x(t), for each w.

The Fourier Transform is a linear and biunivocal transform, so the Inverse Fourier Transform is:


Using the Fourier Transform is possible do analysis of any signal, as thermical, physical, electrical, electromagnetic spectrum, etc.....