MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN...
Transcript of MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN...
![Page 1: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/1.jpg)
MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO
BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN
MONOGRAFIA
Acadêmico:
Fernando Barboza da Costa
Orientador:
Prof. Marcelo Daniel Berejuck, Esp.
PALHOÇA
03/12/2007
![Page 2: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/2.jpg)
2
Estrutura
Introdução; Objetivos; Teoria; Projeto; Desenvolvimento; Validação; Conclusão; Propostas Futuras; Referências.
![Page 3: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/3.jpg)
3
Introdução
Digitalização de sinais;
Compressão de dados;
Técnica semelhante à adotada em imagens;
Sistemas embarcados de baixo custo.
![Page 4: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/4.jpg)
4
Objetivos
Estudo de compressores de dados;
Sem perdas ou baixas perdas;
Foco para descompressão “leve”;
Uso em sistemas embarcados baixo custo;
Redução de custo com menor demanda de memória.
![Page 5: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/5.jpg)
5
Digitalização de áudio - PCM
Ts
1.4
3.3
2.2
4.1
1.1
2.8 2.4
4.6
3.0
Sinal de voz
Amostragem
t
V
V
t
001
011
010
100
001
011
010
101
011
5
1
3
2
4
1
3
2
3
t
V
Quantização PCM
* Inserção de erros.
![Page 6: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/6.jpg)
6
DPCM
1
3
2
4
1
3
2
5
3
001
011
010
100
001
011
010
101
011 t
V
Palavra PCM
Amostras PCM DPCM
1 1 1
2 3 2
3 2 -1
4 4 2
5 1 -3
6 3 2
7 2 -1
8 5 3
9 3 -2
![Page 7: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/7.jpg)
7
Huffman
Inicialmente desenvolvido para texto;
Probabilidade de distribuição;
Menos bits para símbolos mais freqüentes.
![Page 8: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/8.jpg)
8
Huffman
Amostras DPCM
1 1
2 2
3 -1
4 2
5 -3
6 2
7 -1
8 3
9 -2
Valores Incidência
-3 1
-2 1
-1 2
1 1
2 3
3 1
Tabela de incidência.
![Page 9: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/9.jpg)
9
Huffman
Valores Incidência
2 3/9
-1 2/9
-3 1/9
-2 1/9
-1 1/9
3 1/9
Valores Incidência
-3 1
-2 1
-1 2
1 1
2 3
3 1
Ordenação por incidência.
![Page 10: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/10.jpg)
10
Huffman
Árvore e a codificação (borbulhar).
2
-1
-3
-2
-1
3
1/9
1/9
1/9
1/9
2/9
3/9
2/9
2/9
3/9
1/9
1/9
2/9
2/9
2/9
3/9 4/9
3/9
2/9
4/9
5/9
0
1
0
1
0
1
0
1
0
1
Valores Incidência Código
2 3/9 00
-1 2/9 11
-3 1/9 010
-2 1/9 110
-1 1/9 001
3 1/9 101
0
0
![Page 11: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/11.jpg)
11
Huffman
Resultados.
Xi P(Xi) Código Ni NiP(Xi)
2 3/9 00 2 6/9
-1 2/9 11 2 4/9
-3 1/9 010 3 3/9
-2 1/9 110 3 3/9
-1 1/9 001 3 3/9
3 1/9 101 3 3/9
_____
Total 2,444
![Page 12: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/12.jpg)
12
Projeto
Especificação dos algoritmos;
Sugestão das ferramentas para o desenvolvimento;
Detalhes do condicionamento do áudio.
![Page 13: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/13.jpg)
13
Codificador
Diagrama Macro do Codificador
CodicadorArquivo áudio RAW
Arquivo binário
![Page 14: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/14.jpg)
14
Decodificador
Diagrama Macro do Decodificador
Decodicador
Áudio PCM
Arquivo binário
![Page 15: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/15.jpg)
15
Desenvolvimento
Ferramentas utilizadas;
Detalhes da implementação;
Hardware do decodificador;
Simulação do hardware.
![Page 16: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/16.jpg)
16
Codificador
Codificador
Quantizador DPCM
TruncamentoPonderação
DPCMCriação do Dicionário
Codificação em bits
Arquivo áudio RAW
Arquivo binário
GoldWave®
![Page 17: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/17.jpg)
17
Codificador
Codificador
Quantizador DPCM
TruncamentoPonderação
DPCMCriação do Dicionário
Codificação em bits
Arquivo áudio RAW
Arquivo binário
DevC++
![Page 18: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/18.jpg)
18
Codificador
Codificador
Quantizador DPCM
TruncamentoPonderação
DPCMCriação do Dicionário
Codificação em bits
Arquivo áudio RAW
Arquivo binário
WinHex
![Page 19: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/19.jpg)
19
Quantizador DPCM
Codificador
Quantizador DPCM
TruncamentoPonderação
DPCMCriação do Dicionário
Codificação em bits
Arquivo áudio RAW
Arquivo binário
Tabela de incidência dos valores DPCM encontrados.
![Page 20: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/20.jpg)
20
Ponderação DPCM
Codificador
Quantizador DPCM
TruncamentoPonderação
DPCMCriação do Dicionário
Codificação em bits
Arquivo áudio RAW
Arquivo binário
Ordenação decrescente dos valores DPCM.
![Page 21: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/21.jpg)
21
Dicionário Huffman
Codificador
Quantizador DPCM
TruncamentoPonderação
DPCMCriação do Dicionário
Codificação em bits
Arquivo áudio RAW
Arquivo binário
Vetor em ordem decrescente de incidência.
![Page 22: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/22.jpg)
22
Código de Huffman Alterado
Codificador
Quantizador DPCM
TruncamentoPonderação
DPCMCriação do Dicionário
Codificação em bits
Arquivo áudio RAW
Arquivo binário
Gera bits “1” de acordo com o número do índice no vetor do dicionário;
Finaliza com um bit “0”.
Índice Dicionário Código
0 X 0
1 X 10
2 X 110
3 X 1110
4 X 11110
n X (n*1)+0
![Page 23: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/23.jpg)
23
Arquivo binário
Codificador
Quantizador DPCM
TruncamentoPonderação
DPCMCriação do Dicionário
Codificação em bits
Arquivo áudio RAW
Arquivo binário
Agrupa os bits de acordo a plataforma utilizada;
8051 = 8 bits.
![Page 24: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/24.jpg)
24
Decodificador
Hardware - Proteus®
Decodificador
Decodificador de bits
Leitura do Dicionário
Quantizador DPCM
Áudio PCM
Arquivo binário
![Page 25: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/25.jpg)
25
Decodificador
Software - Keil®
Decodificador
Decodificador de bits
Leitura do Dicionário
Quantizador DPCM
Áudio PCM
Arquivo binário
![Page 26: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/26.jpg)
26
Decodificador de Huffman
Conta bits “1” entre bits “0”.
Decodificador
Decodificador de bits
Leitura do Dicionário
Quantizador DPCM
Áudio PCM
Arquivo binário
![Page 27: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/27.jpg)
27
Usa o contador como índice no dicionário.
Decodificador
Decodificador de bits
Leitura do Dicionário
Quantizador DPCM
Áudio PCM
Arquivo binário
Dicionário Huffman
![Page 28: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/28.jpg)
28
Soma o valor DPCM lido à amostra anterior.
Decodificador
Decodificador de bits
Leitura do Dicionário
Quantizador DPCM
Áudio PCM
Arquivo binário
Quantizador DPCM
![Page 29: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/29.jpg)
29
Decodificador
code_atual <<= 1;
if ( CY == 0 ){
amostra = amostra + code_book[cont_bits];cont_bits = 0;
}else{
cont_bits++;}
Decodificador
Decodificador de bits
Leitura do Dicionário
Quantizador DPCM
Áudio PCM
Arquivo binário
![Page 30: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/30.jpg)
30
Decodificador
Decodificador
Decodificador de bits
Leitura do Dicionário
Quantizador DPCM
Áudio PCM
Arquivo binário
![Page 31: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/31.jpg)
31
Validação
Taxa de codificação ~38%;
Redução em espaço de memória;
Ambiente simulado;
Decodificador embarcado no 8051 (baixo custo);
Baixas perdas.
![Page 32: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/32.jpg)
32
Conclusão
Estudo de técnicas de compressão e codec’s;
Taxas satisfatórias;
Aplicável a produtos comerciais de baixo custo:• Unidades Resposta Audível (URA);• Esperas telefônicas;• Secretária eletrônica (DTAM).
Performace codificador x amplitude do sinal.
![Page 33: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/33.jpg)
33
Propostas futuras
Aplicação com PCM linear 16 bits;
Reduzir ou eliminar a dependência do codificador com a amplitude;
Estudar aplicação com sinais de voz dinâmicos:• VOIP;• Telefones sem fio digital.
![Page 34: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/34.jpg)
34
Referências
COUCH, Leon W.. DIFFERENCIAL PULSE CODE MODULATION In: COUCH, Leon W.. COUCH, Leon W.. DIFFERENCIAL PULSE CODE MODULATION In: COUCH, Leon W.. Digital and Analog Communication systems: Sixth edition: Prentice Hall PTR, 2000. p. Digital and Analog Communication systems: Sixth edition: Prentice Hall PTR, 2000. p. 188-191.188-191.
COUCH, Leon W.. PULSE CODE MODULATION In: COUCH, Leon W.. Digital and COUCH, Leon W.. PULSE CODE MODULATION In: COUCH, Leon W.. Digital and Analog Communication systems: Sixth edition: Prentice Hall PTR, 2000. p. 137-151.Analog Communication systems: Sixth edition: Prentice Hall PTR, 2000. p. 137-151.
RIBEIRO, Paulo Sérgio. Visão geral das telecomunicações: Parte II. In: RIBEIRO, Paulo Sérgio. Visão geral das telecomunicações: Parte II. In: Comunicações Digitais III, 2007, Palhoça. UnisulComunicações Digitais III, 2007, Palhoça. Unisul
RUSCHEL, Orlando T. Princípios da Comunicação Digital. Porto Alegre: EDIPUCRS, RUSCHEL, Orlando T. Princípios da Comunicação Digital. Porto Alegre: EDIPUCRS,
19961996 SKLAR, Bernard. HUFFMAN CODES In: SKLAR, Bernard. Digital Communications, SKLAR, Bernard. HUFFMAN CODES In: SKLAR, Bernard. Digital Communications,
Fundamentals and Applications: Second edition: Prentice Hall PTR, 2002. p. 862-866.Fundamentals and Applications: Second edition: Prentice Hall PTR, 2002. p. 862-866.
WILLRICH, Roberto. WILLRICH, Roberto. Conversão A/D e D/A. In: Voz sobre IP Parte I, 2005, Conversão A/D e D/A. In: Voz sobre IP Parte I, 2005, Florianópolis. UFSCFlorianópolis. UFSC
![Page 35: MODELO DE ALGORITMO PARA COMPRESSÃO DE ÁUDIO BASEADO NA TÉCNICA DPCM E ALGORITMO DE HUFFMAN MONOGRAFIA Acadêmico: Fernando Barboza da Costa Orientador:](https://reader031.fdocumentos.com/reader031/viewer/2022020122/552fc175497959413d8ef5d5/html5/thumbnails/35.jpg)
35
Agradecimentos
A Deus;
A família, em especial à esposa e ao filho;
Ao orientador Prof. Marcelo Daniel Berejuck, Esp.;
Aos professores da Unisul em especial ao Prof. Mauro Pacheco Ferreira, M.sc.;
Aos colegas de trabalho da Intelbras, em especial Robson Veronezi, Nelson Campaner, Patrick Argoud e Fernanda Argoud;
Aos esquecidos;