0% found this document useful (0 votes)
28 views

Embedded Madness

The project report details the development of a digital Tanpura sound synthesizer using an 8051 microcontroller, aimed at providing a portable and easy-to-use alternative for vocal performances. The system utilizes frequency spectrum analysis and harmonic generation to replicate the Tanpura's sound, with push-button controls for real-time frequency selection. The report concludes with successful simulation results and outlines potential improvements, including the addition of PWM signals and analog filters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Embedded Madness

The project report details the development of a digital Tanpura sound synthesizer using an 8051 microcontroller, aimed at providing a portable and easy-to-use alternative for vocal performances. The system utilizes frequency spectrum analysis and harmonic generation to replicate the Tanpura's sound, with push-button controls for real-time frequency selection. The report concludes with successful simulation results and outlines potential improvements, including the addition of PWM signals and analog filters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Embedded Systems

Project Report

Title:
Project-12
Synthesis of Tanpura Sound using 8051
based Embedded System.

Group-12

Members:
Kinjal Bhattacharyya, Roll: 122EE0146
Trideva Chatterjee, Roll: 122EE0147
Pratul Dev, Roll: 122EE0148
Objective:

The development of a digital system that mimics the sound of a


Tanpura is essential, especially in scenarios where skilled players
are unavailable. Such a system o ers the added advantages of
portability and ease of use, requiring minimal expertise to
operate. This makes it an ideal solution for vocal performances
where the Tanpura serves as an accompanying instrument. Our
goal is to create a digital Tanpura using an 8051
microcontroller, designed to accurately synthesize the authentic
sound of the Tanpura.

Approach:

Frequency Spectrum Analysis of the Tanpura:

Frequency response obtained for a string tuned at 500Hz, shows


peak at the fundamental, 2nd and 3rd harmonics. (Ref.
Acoustical Analysis of Tanpura, Indian Plucked String
Instrument)
ff
Synthesis of the Sinusoid with Harmonics:
To obtain the sinusoid with harmonics, an ideal signal is
sampled which has the Time Period = LCM( Time period of all
the harmonics) at a rate which is following the Criterion for
reconstruction i.e. Sampling Frequency ≥ 10*(Frequency of
Maximum Harmonic).

Following this, the Sampling Rate was chosen to be 35 per time


period of the fundamental harmonic. And, the following python
script was written for sampling the signal and getting 8 bit
values.
Ampli cation of the Signal Obtained from DAC:

A preampli er circuit utilising a BJT in a common emitter


con guration, with C2 functioning as a blocking capacitor and
C1 as a coupling capacitor. The gain achieved in this setup is
suitable for driving the speaker circuit.

Push Buttons to Produce di erent signals:

The push buttons interfaced with the 8051uC sets di erent


frequencies. The values we chose for this particular application
were: 130Hz(C3), 155Hz(D#3), 174Hz(F3) & 185Hz(F#3).
fi
fi
fi
ff
ff
Bill Of Materials:

Sl. Item Speci cation Quanti Cost


No ty
1 8051 Controller- 1 Rs.
Development AT89S52 1010/-
Board
2 Digital to Analog DAC0808 1 Rs.
Converter 149/-
3 Speaker 4W 2 Rs.
200/-
4 Bipolar Junction BC547 1 Rs.
Transistor 18/-
5 Resistors 10kΩ, 3.3kΩ, 1kΩ, As Rs.
200Ω, 100Ω required 30/-
6 Capacitors 100uF, 1uF, 10nF As Rs.
required 50/-
7 Bread Board - - Rs.
150/-
Total Rs.
1607/-
fi
Circuit Diagram:

Push Button 8051uC DAC0808 I to V Signal using Op-Amp

BC547 based Preamp


Code in 8051 Assembly:

;====================================================================

; DEFINITIONS

;====================================================================

TABLE_SIZE EQU 35 ; Total number of sine samples in the lookup table

;====================================================================

; VARIABLES

;====================================================================

ORG 0030H ; Starting address of sine lookup table

SINE_TABLE:

DB 63, 90, 111, 124, 127, 119, 105, 87, 72, 61, 57, 59

DB 65, 73, 78, 79, 75, 68, 58, 51, 47, 48, 53, 61

DB 67, 69, 65, 54, 39, 21, 7, 0, 2, 15, 36 ; Sine wave samples

;====================================================================

; RESET AND INTERRUPT VECTORS

;====================================================================

ORG 0000H ; Reset vector address

JMP Start ; Jump to start of program

ORG 000BH ; Timer 0 interrupt vector address

JMP TIMER0_ISR ; Jump to Timer 0 interrupt service routine

;====================================================================
; CODE SEGMENT

;====================================================================

ORG 0100H ; Start of program code

Start:

MOV TMOD, #01H ; Set Timer 0 to mode 1 (16-bit timer mode)

MOV TH0, #0FFH ; Load high byte for Timer 0

MOV TL0, #35H ; Load low byte for Timer 0

MOV R0, #00H ; Initialize sine table index to 0

MOV R1, #0FFH ; High byte for Timer reload value

MOV R2, #35H ; Low byte for Timer reload value

MOV P1, #00H ; Clear Port 1

SETB ET0 ; Enable Timer 0 interrupt

SETB EA ; Enable global interrupts

SETB TR0 ; Start Timer 0

Main_Loop:

JB P1.0, Set130HZ ; Check if P1.0 is high, set frequency to 130Hz

JB P1.1, Set155HZ ; Check if P1.1 is high, set frequency to 155Hz

JB P1.2, Set174HZ ; Check if P1.2 is high, set frequency to 174Hz

JB P1.3, Set185HZ ; Check if P1.3 is high, set frequency to 185Hz

SJMP Main_Loop ; In nite loop to continuously check input

Set130HZ:

MOV R1, #0FFH ; Set high byte for 130Hz frequency

MOV R2, #35H ; Set low byte for 130Hz frequency

SJMP Main_Loop ; Return to main loop

Set155HZ:
fi
MOV R1, #0FFH ; Set high byte for 155Hz frequency

MOV R2, #56H ; Set low byte for 155Hz frequency

SJMP Main_Loop ; Return to main loop

Set174HZ:

MOV R1, #0FFH ; Set high byte for 174Hz frequency

MOV R2, #68H ; Set low byte for 174Hz frequency

SJMP Main_Loop ; Return to main loop

Set185HZ:

MOV R1, #0FFH ; Set high byte for 185Hz frequency

MOV R2, #71H ; Set low byte for 185Hz frequency

SJMP Main_Loop ; Return to main loop

;====================================================================

; INTERRUPT SERVICE ROUTINE

;====================================================================

TIMER0_ISR:

MOV TH0, R1 ; Reload high byte of Timer 0

MOV TL0, R2 ; Reload low byte of Timer 0

MOV A, R0 ; Load current index from R0

MOV DPTR, #SINE_TABLE ; Load address of sine lookup table

MOVC A, @A+DPTR ; Fetch sine value corresponding to index

MOV P2, A ; Output sine value to Port 2

INC R0 ; Increment sine table index

MOV A, R0 ; Load updated index


CJNE A, #TABLE_SIZE, ISR_End ; Check if end of sine table is reached

MOV R0, #00H ; Reset index to start of sine table

ISR_End:

RETI ; Return from interrupt

;====================================================================

END ; End of program


Test Results:
The nal circuit obtained looks like the following with the
speakers producing frequencies in accordance to push buttons
pressed.

Output waveform of the sinusoidal signal with Harmonics fed


into the speakers obtained from Proteus
Simulation of the Circuit.

Output waveform from simulation

Spectra obtained from Hardware


fi
Conclusion:
The synthesis of Tanpura sound using an 8051-based embedded
system successfully demonstrated the ability to digitally
replicate its characteristic tones. By leveraging frequency
spectrum analysis, sinusoidal waveform synthesis, and harmonic
generation, the system produced audible outputs akin to a
traditional Tanpura. Push-button controls enabled real-time
frequency selection, while the use of DAC and preampli ers
ensured smooth signal conversion and ampli cation. Simulations
validated the system’s design, highlighting its potential for
practical applications in music accompaniment. The project
showcases the e ectiveness of embedded systems in recreating
traditional musical instruments, o ering a portable and user-
friendly solution for Tanpura accompaniment.

Scope for Improvements:


1. Addition of PWM based signals to simulate the plucking of
the strings.

2. Inclusion of Analog lters in order to minimise noise due to


discrete nature of the output from DAC.

3. Using of audio ampli ers like PAM-8403 for features like


stereo control etc.
ff
fi
fi
ff
fi
fi

You might also like