Problems of Forensic Sciences 2017, vol. 109, 27–42

PROPERTIES OF RECORDINGS AND AUDIO FILES SAVED IN AMR FORMAT AND AN ASSESSMENT OF THE POSSIBILITY OF APPLYING THEM IN AUTHENTICITY EXAMINATIONS

Marcin MICHAŁEK

Institute of Forensic Research, Kraków, Poland

Abstract One of the commonly used formats for recording audio on mobile devices is Adaptive Multi-Rate (AMR). It was primarily de- signed to transmit and store speech, although it can also be used to record other acoustic signals. AMR file format is mainly used for recording audio on mobile phones with a voice recorder function. It can also be used for storing so-called voice messages, offered as a service by mobile telephony operators. Recordings originating from memories, including in AMR format, are currently a significant part of all analysed evidence recordings. That is why it is important to analyse the authenticity of AMR audio recordings. The purpose of this work was to analyse recordings and audio files stored in AMR file format and to study their application in authenticity examinations. Another goal was to create our own software to automatically analyse the file structure of such recordings. The study was based on AMR audio recordings which were made using different brands and models of mobile phones. The obtained results allowed us to establish that recording in the seemingly uncomplicated AMR file format enables the authenticity of such recordings to be investigated. It is also possible to use well-known methods such as the Electrical Network Criterion and file properties and structure in such investigations. An algorithm and software for the automatic analysis of the integrity of AMR audio files in the MATLAB computing environment were also developed.

Key words AMR; Authenticity analysis; Digital recording; File structure.

Received 24 July 2017; accepted 19 September 2017

1. Introduction cellular telephony (3GPP, 2011b; Sjoberg, Wester- lund, Lakaniemi, Xie, 2007). Apart from application Adaptive Multi-Rate (AMR) codec was standard- in mobile communication systems, AMR is also used ized by the European Telecommunications Standards for transmitting speech in audio and video conferences Institute (ETSI) and has been developed since 1999 and also in satellite and VoIP communication. It en- by the 3rd Generation Partnership Project (3GPP). It sures acceptable speech signal quality even for weak is available in two variants, Adaptive Multi-Rate Nar- connection parameters (Bhatt, Kosta, 2011; Sjoberg et rowband, also referred to as AMR-NB, and Adaptive al., 2007). This format is also applied to speech play- Multi-Rate Wideband, AMR-WB (3GPP, 2011a; ETSI, back in audiobooks and in voice messages. 2002). AMR and AMR-WB were originally designed AMR is also a file format for audio recordings, for application in communication systems. Due which uses the narrow band version of the above men- to the flexibility of this codec and the possibility of tioned codec (3GPP, 2011a; Sjoberg et al., 2007). Au- its adaptation to connections of varying quality, it has dio recordings in this format are recorded mainly with also found application in GSM and UMTS mobile the use of mobile phones, but also by other popular 28 M. Michałek mobile devices, e.g., tablets (Luo, Yang, Huang, 2015; The AMR codec works in such a way that it divides Michałek, 2016). AMR enables you to save recordings the entire recording into shorter fragments – so-called onto audio files of differing quality at a bit rate of from frames – of 20 ms duration. For a sampling frequency 4.75 to 12.2 kb/s (3GPP, 2011a). This format can also of 8000 Hz, an individual frame contains 160 samples. be applied to storing sound inside the structure of so- In each frame, the speech signal is analysed and pa- called multimedia containers, in which video or audio rameters of the ACELP model are determined: LPC recordings are saved. Examples are files in 3GP and coefficients, adaptive and fixed codebooks as well MP4 format, which are very popular in modern mobile as gains. In order to reproduce the content of the re- devices, especially mobile phones (3GPP, 2010; Gloe, cording, the decoder, on the basis of parameters of the Fischer, Kirchner, 2014). ACELP model, performs a process of synthesis of the This paper focuses on the properties of audio re- coded signal (3GPP, 2011a; ETSI, 2002). cordings and files stored in AMR-NB format and the The following is a brief description of the prin- possibilities of using them in authenticity examina- ciples of operation of the AMR encoder on the basis tions. The study was conducted using audio record- of (3GPP, 2011a, 2011b; ETSI, 2002; Sjoberg et al., ings that were recorded by mobile phones with a voice 2007). The process of recording sound in a file using recorder function and saved in so-called voice mail- the AMR codec can be divided into several main stag- boxes of mobile network operators. es. In the first stage, a short-term analysis is performed Currently, authenticity examinations of digital re- and coefficients of linear prediction (LPC) of the th10 cordings require the concatenation of results and con- order are calculated using the Levinson-Durbin algo- clusions from various audio research methods, as well rithm, according to the formula: as – frequently – computer forensic methods (Kaj- 1 Hz()= stura, Michałek, Trawińska, 2017). The results of the m (1) 1 ˆ za -i performed research show that making recordings in + å i the relatively uncomplicated AMR format allows the i=1 use of recognised and applied methods for authenti- ˆ where: ai are the linear prediction coefficients, and cation examinations, such as analysis of the electrical m = 10 is the order of prediction. network frequency as well as file properties and file Formula (1) enables short-term analysis of the sig- structure (Hong, Yin, 2013; Grigoras, 2005; Kajstura nal in which the vocal tract is modelled. At this stage, et al., 2017). long-term analysis is also carried out and parameters The analyses described in this article were con- of the pitch function of the vocal tract are calculated ducted as part of a research project carried out at the with the aim of later synthesis of the speech signal by Institute of Forensic Research in Krakow. means of the following formula: 11 = -T (2) 2. Audio coding in AMR format files B()z 1- p zg

AMR format files do not contain coded sound sam- where: T is the pitch delay and g is the pitch gain. ple after sample, but in the form of coefficients de- A so-called Adaptive Codebook – described in scribing successive fragments of recording. This co- greater detail below – is created on the basis of long- dec uses a linear prediction algorithm called Algebraic term analysis. Codebook Excitation Linear Prediction (ACELP), At the next coding stage, the already calculat- which is a modification of the popular Linear Pre- ed LPC coefficients are converted into Line Spectral dictive Coding (LPC) algorithm used for coding and Pairs (LSP) for further quantization. This conversion describing a speech signal (3GPP, 2011b; Luo et al., is conducted on the basis of the decomposition of ' F ' 2015). function A(z) into polynomials F1 and 2 according to Before the actual process of audio coding using the formula: AMR is carried out, initial preparation of the audio ' –11 –1 F1 ()z A()z += Az ()z signal occurs, which consists of conversion of the (3) ' –11 –1 analogue signal into a digital form with the follow- and F2 ()z = A()z – Az ()z ing parameters: 13 bit resolution, sampling frequency 8000 Hz and Pulse Code Modulation (PCM) coding. Next the determined LSP coefficients are subject- The signal is also subjected to high-pass filtering with ed to quantization in the frequency domain in accord- a cut-off frequency of 80 Hz (3GPP, 2011b). ance with the formula:

Problems of Forensic Sciences 2017, vol. 109, 27–42 Properties of recordings and audio files saved in amr format and an assessment of the possibility of applying them in... 29

f – Samsung: Galaxy Ace III, GT-C3350 and Solid f = s arccos()q i π2 i (4) B2100; – Siemens C75; where: i=1,...,10, fi are the Line Spectral Frequencies – Sony Ericsson: W595S and WT19i. (LSF) in the range [0, 4000] Hz corresponding to LSP 181 test recordings were made in AMR format us- coefficients, fs is the sampling frequency of 8000 Hz, ing the above mentioned phones. The voice recorder whilst qi are the LSP coefficients in the cosine domain. function and message recording service in cellular op- Coefficients quantized in the above way are then sub- erators’ voicemail boxes were used for this purpose, jected to linear interpolation, and then transformed and messages were then saved into the memory of back into quantized LPC coefficients. telephones in AMR format files. During recording, the In the next stage, a single frame containing 160 available functions were made use of – i.e., the start, samples is divided into four equal parts – so-called sub- stop and pause functions. They were recorded in vari- frames – with 40 samples each, and each lasting 5 ms. ous acoustic conditions – in closed rooms and in open Depending on the bit rate of the AMR Codec, quan- spaces – and contain a range of sounds and intentional tized and non-quantized LPC coefficients and interpo- noises over a reasonably broad range of frequencies. lated LSP coefficients are used in various subframes. After being saved in the phone memory, each of the Parameters of the Adaptive Codebook and the Fixed test recordings was copied onto the hard disc of the Codebook are determined on the basis of subframes. laboratory computer, or a memory image was made The Adaptive Codebook is determined on the basis of for the device. long-term analysis and contains excitation vectors of In order to assess the possibility of using parame- variable values with the aim of adaptation to parame- ters of recordings and files stored in AMR format in ters of the speech signal for each subframe. However, authenticity examinations, the test recordings were the Fixed Codebook contains excitation vectors with subjected to analyses of the following: fixed values. At the last stage of coding of AMR, tech- – time and frequency characteristics with simultane- niques are used to determine pitch and their gains as ous auditory analysis; well as intervals between pitch for the analysed frames – electrical network frequency signal – a special case (Open-loop Pitch Search and Closed-loop Pitch Anal- of analysis of the characteristics of the recording; ysis) in order to determine the most optimal parame- – properties of files that are read by the Windows op- ters of the encoded speech signal. erating system and by tools designated for analysis The saving of the recording into the file occurs in of multimedia files; such a way that for each frame of 20 ms, the coder – structure of data saved in AMR format files, using generates 95, 103, 118, 134, 148, 159, 204 or 244 bits programmes for visualisation and editing in hexa- for a bit rate of 4.75, 5.15, 5.9, 6.7, 7.4, 7.95, 10.2 or decimal and ASCII code. 12.2 kb/s, respectively. After encoding a single frame, the memory of the coder is updated with the aim of calculating parameters for the next frame. The struc- 4. Results ture of each AMR file consists of its header, followed by an ordered collection of frames containing succes- 4.1. Analysis of characteristics and auditory sive coded fragments of the recording (3GPP, 2011b; analysis Sjoberg et al., 2007). Analysis of time and frequency characteristics combined with auditory analysis is a research meth- 3. Research material and applied methods od applied mainly to the assessment of the continuity of a recording (Błasikiewicz, Miściuk, Wójcik, 1967; In order to conduct the intended research, record- Kajstura et al., 2017; Koenig, 1990). For the purpose ing functions on 25 mobile phones of the following of analysis of the characteristics of the recorded test brands and models were analysed: recordings, they were converted from AMR format – BlackBerry: 8520 and 9320; into uncompressed WAVE PCM format with the help – HTC Wildfire; of Adobe Audition software. It was established that – LG 9; the frequency of sampling of all AMR recordings was – MaxCom MM461BB; 8000 Hz, and the frequency band of recorded sounds – : 2700, 3100c, 6103, 6230, 6300, 6500c, C1- was within the range of approximately 200–3400 Hz. 01, C2-02, E50, E52-1, E65, and N95; The occurrence of the so-called DC offset was not

Problems of Forensic Sciences 2017, vol. 109, 27–42 30 M. Michałek ascertained in any of the test recordings. Some of is widely recognised and applied by leading forensic the mobile phones used in the research had a pause audio laboratories; it can be described as a special function which could be used to pause the recording, type of analysis of the characteristics of a recording. which caused a discontinuity of the recording. On the Above all, it enables you to determine the continuity basis of audio analysis and analysis of characteristics of a recording and the date and time that it was re- of AMR recordings, it was established that it is possi- corded (Grigoras et al., 2009; Kajstura et al., 2005; ble to reveal a discontinuity of the recording within the Michałek, 2009). Analyses of the characteristics of the speech signal or other signals of known parameters. test recordings in AMR format in the present research The above, however, is dependent on parameters of showed that in some of them it was possible to re- the mentioned signals, especially their signal-to-noise cord the second harmonic of the power line hum, i.e., ratios. In recordings made with older telephone mod- around 100 Hz frequency. Importantly, the amplitude els, application of the pause function often caused re- and continuity of this signal enabled its extraction, cording of characteristic noises linked with the use of calculation of instantaneous values of frequency and function keys. However, the use of touch screens in comparison with reference values. This harmonic was newer phones does not enable or significantly limits recorded in recordings made using various bit rates, the recording of such noises. Characteristic traces in and it was noted in recordings made on Nokia, Sony the structure of AMR files have not been ascertained Ericsson and Samsung telephones. However, in none after application of the pause function either. It has of the test recordings was the presence of a power line been observed that the so-called acoustic background hum signal with a fundamental frequency, i.e., about of a recording in AMR format may be characterised by 50 Hz, ascertained. sudden changes in characteristics even though the re- Fig. 1 shows the recorded second harmonic of the cording is continuous and recorded in uniform acous- power line hum signal in an AMR recording made on tic conditions, which is dependent on the change in a Sony Ericsson W595S telephone with a bit rate of amplitude of recorded sounds. The AMR format was 12.2 kb/s. mainly designed for the transmission and recording of As part of the research, the influence of the bit rate the speech signal, and the sound in the file is recorded of the AMR codec on the value of the amplitude of only in the form of coefficients and is characterised by the second harmonic of the power line hum signal was fairly strong compression. Accordingly, conclusions also analysed. The amplitude of the power line hum from an analysis of the integrity of an AMR recording is one of the most important parameters of this sig- using auditory analysis and analysis of characteristics nal (Grigoras, 2005; Kajstura et al., 2005; Michałek, of the recording should be verified by an additional 2009). In order to do this, a test recording in uncom- method. pressed format, containing a harmonic of the power line hum with a frequency of about 100 Hz was con- 4.2. Electrical network frequency analysis verted with the help of the popular ffmpeg codec to re- cordings in AMR format using the available bit rates. One of the basic methods of investigating the au- The highest value of amplitude of the second harmon- thenticity of digital recordings is to analyse power line ic was obtained for a recording coded with a bit rate hum, changes in the frequency of which correspond of 12.2 kb/s, but a drop of –4 dB was noted in relation to frequency fluctuations of the current in the electri- to the harmonic amplitude from the uncompressed re- cal network (Grigoras, 2005). This is a method that cording. For the bit rates: 10.2, 7.95, 7.4, 6.7, 5.9, 5.15

Fig. 1. Second harmonic of the power line hum signal in an AMR recording made using a Sony Ericsson W595S mobile phone.

Problems of Forensic Sciences 2017, vol. 109, 27–42 Properties of recordings and audio files saved in amr format and an assessment of the possibility of applying them in... 31 and 4.75 kb/s, further drops in amplitude of this signal tion of recording and bit rate in kb/s. Table 1 presents were noted, being, respectively: –4.35, –4.65, –6.75, a comparison of actual bit rate values of AMR test files –7.7, –8.9, –9.8 and –10 dB in relation to the uncom- in the range of 4.75 to 12.2 kb/s with values obtained pressed recording. It follows that use of a lower bit using the mentioned programmes. rate during AMR coding, i.e., stronger compression, causes a reduction in the value of the amplitude of the Table 1 second harmonic of the power line hum signal. It was Real values of AMR bit rates compared with values found that a change in this amplitude did not have an obtained using three popular software designated for effect on the correctness of verification of the time multimedia files analysis when the prepared recordings were made in relation to the reference database, on condition, however, of AMR bit rate [kb/s] an acceptable signal-to-noise ratio (Michałek, 2009). Frame header GSpot MediaInfo ffprobe 4.3. Analysis of AMR audio files properties 4.75 file unknown 5.2 5 5.15 file unknown 5.6 5 On the basis of the test recordings made in AMR 5.9 file unknown 6.4 6 format, it was established that each of them was saved 6.7 file unknown 7.2 7 to a file with the filename extension*.amr . 7.4 file unknown 8.0 8 The basic method of analysis of files, including au- 7.95 file unknown 8.4 8 dio files, is to read the information presented by the 10.2 file unknown 10.8 10 operating system of the computer. This includes: file type; timestamps for creation, modification and last 12.2 file unknown 12.8 12 access; and file size. For recognised formats, the oper- ating system also gives parameters relating to the sav- ing of the audio file such as: format, coding algorithm, 4.4. Analysis of data structure in AMR format bit rate, sampling frequency and quantization resolu- files tion (Hong, Yin, 2013; Kajstura et al., 2017; Michałek, 2016). Dedicated programmes are also available for One of the methods applied during authenticity in- reading detailed information about an audio file. vestigations of multi-media recordings is analysis of Using the File properties option of Windows op- the data structure of files in which these recordings are erating systems – XP Professional, 7 Ultimate and 10 saved. This analysis is carried out using programmes Professional – information was obtained about the that enable visualisation and editing of files in so- AMR audio files recorded in this research. It was es- called hexadecimal code. Multimedia files have meta- tablished that all the mentioned Windows operating data in their structure, which describe the data con- systems only presented basic information on files in stituting the encoded recording. Metadata can contain AMR format such as: names of files, their size, and significant information about a file, for example: the type of file: AMR Narrow-Band Content, as well as format of the recording and its parameters, the coding the date and time of creation, modification and last ac- algorithm, timestamps and the name of the recording cess. device. Analysis of the structure of the file also ena- Several popular programmes designed for analy- bles you to disclose any possible disturbances of its sis of multimedia files were also used for analysis of integrity, as well as entries indicating editing of the file the properties of files saved in AMR format: GSpot v. with the help of computer software (Hong, Yin, 2013; 2.70, MediaInfo v. 0.7.95 and ffprobe as part of ffmpeg Kajstura et al., 2017). v. N-81664-g6f062eb. Analysis of the structure of files with test recordings GSpot does not recognise files stored in AMR in AMR format showed that each of them contains a 6 format and does not provide any detailed informa- byte file header, which is saved as 23 21 41 4D 52 0A tion about them. MediaInfo and ffprobe recognise the in hexadecimal code, which corresponds to #!AMR\n AMR format and present the following information in ASCII code. An example AMR file header is pre- correctly: file format (Adaptive Multi-Rate Narrow- sented in Fig. 2. band), size, number of channels (1), sampling fre- For the AMR-WB format, the file header is quency (8000 Hz) and bit resolution (13 bits). Both 23 21 41 4D 52 2D 57 42 0A in hexadecimal, which programmes, i.e., MediaInfo and ffprobe, additionally corresponds to #!AMR-WB\n in ASCII code. provide the following information imprecisely: dura-

Problems of Forensic Sciences 2017, vol. 109, 27–42 32 M. Michałek

Directly after the file header is the ordered frame Fig. 3 shows a portion of data from one of the AMR structure. Each frame in an individual file contains test files with the structure of the first five frames high- a coded fragment of recording with a constant bit rate. lighted. As can be seen, each frame contains a header At the beginning of each frame is its 1 byte header, with a value of 14 in hexadecimal notation, which in- which stores information about the coding mode, the dicates that its size is 16 bytes, and the data are char- bit rate and possible errors in the frame data. Audio in acterised by a bit rate of 5.9 kb/s. AMR format files is coded in eight modes with a bit Analysis of AMR files containing test recordings rate that is dependent on the quality of recording: made using the voice recorder function showed that 4.75, 5.15, 5.9, 6.7, 7.4, 7.95, 10.2 or 12.2 kb/s. Each frame headers had values between 04 and 3C. Table 3 frame contains a fragment of recording lasting 20 ms, shows the obtained parameters of audio files recorded but – depending on the AMR mode for the given de- using the voice recorder function of the studied mobile vice – the amount of bytes in each frame and its size phones. vary. Table 2 presents information concerning possi- It was established that all recordings originating ble AMR coding modes, bit rate, the size in bytes of from voice mailboxes of the operator frames containing coded sound, and the frame header PLAY which were recorded in AMR file format have a in hexadecimal notation. frame header with a value of 2C, and a bit rate of 7.95 kb/s. Table 4 presents the parameters of the mentioned Table 2 files, including the brand and model of mobile phone Values of AMR bit rates, frame sizes and frame head- on which they were saved. ers, depending on AMR modes As mentioned, the AMR file structure contains in- formation about: the file format, coding mode, bit rate AMR mode AMR bit Frame size Frame header and possible errors in frames. However, analysis of rate [kb/s] [bytes] [HEX] this structure did not reveal the presence of data on: AMR_4.75 4.75 13 04 the phone brand and model, the date and time of re- AMR_5.15 5.15 14 0C cording, and the size of the file. Due to the fact that in a single AMR file, each AMR_5.9 5.9 16 14 frame has the same header and length, they form an AMR_6.7 6.7 18 1C ordered data structure. On this basis, you can perform AMR_7.4 7.4 20 24 an analysis of the AMR file to assess its consistency AMR_7.95 7.95 21 2C and detect any possible disturbances or edits. Fig. 3 AMR_10.2 10.2 27 34 shows a fragment of data from one of the AMR test AMR_12.2 12.2 32 3C files that has a consistent structure. Fig. 4 shows the initial fragment of the same file, but – starting from the second frame – part of the data corresponding to about

Fig. 2. The file header of an AMR audio file.

Fig. 3. Frames structure inside an AMR audio file.

Problems of Forensic Sciences 2017, vol. 109, 27–42 Properties of recordings and audio files saved in amr format and an assessment of the possibility of applying them in... 33

Table 3 Table 4 AMR file parameters collected from tested devices: AMR file parameters collected from tested devices: voice recorder function voice mailboxes

Mobile phone: voice recorder function Mobile phone: voice mailboxes (PLAY operator) Frame header Frame size Bit rate Frame header Frame size Bit rate Brand and model Brand and model [HEX] [bytes] [kb/s] [HEX] [bytes] [kb/s] BlackBerry 8520 3C 32 12.2 HTC WildFire 2C 21 7.95 BlackBerry 9320 3C 32 12.2 LG 9 2C 21 7.95 MaxCom MM461BB 3C 32 12.2 SAMSUNG GT- C3350 2C 21 7.95 Nokia 3100c 14 16 5.9 SONY Ericsson Nokia 6103 14 16 5.9 WT19i 2C 21 7.95 Nokia 6230 3C 32 12.2 14 16 5.9 continuous recordings. It was noticed that the length Nokia 6500c 3C 32 12.2 of some frames with coded sound did not correspond Nokia C1-01 3C 32 12.2 to the length indicated in their headers. There were Nokia C2-02 3C 32 12.2 various locations of these disturbances in successive 0C 14 5.15 files created on the mentioned mobile phone. Fig.5 Nokia E52-1 3C 32 12.2 shows the initial fragment of an AMR file recorded Nokia E65 0C 14 5.15 with the above phone, which illustrates the above de- scribed problem. In this diagram, frame headers with Nokia N95 0C 14 5.15 a value of 3C are boxed and the incorrect seventh Nokia 2700 3C 32 12.2 frame is highlighted. These types of disturbances in Samsung Solid B2100 14 16 5.9 structure were not noted in AMR files recorded by the Samsung Galaxy 3C 32 12.2 remaining studied phones. ACE III The above described self-arising disturbances in Siemens C75 04 13 4.75 AMR file structure do not mean that such a file has Sony Ericsson W595S 3C 32 12.2 been edited using computer software. However, they indicate a characteristic feature for the analysed phone. 0.2 seconds of recording has been removed from it. That is why making test recordings with the studied In the diagram, the second frame – from which audio recorder and performing a comparative analysis with data have been removed – is highlighted, and headers evidential recordings are such significant elements of of frames in the processed file are boxed. As can be an authenticity examination (Michałek, 2016). seen, as a result of this edition, the structure of the file On the basis of analysis of recordings made for the has been disturbed. purposes of this research paper, it was not ascertained On the basis of analysis of the structure of the test that application of the pause function in the course recordings, it was established that in AMR files record- of recording caused disturbances in data structure in ed using a Nokia E52-1 telephone, there are distur- AMR files. bances in the data structure in correctly executed and

Fig. 4. Inconsistent structure of tampered AMR audio file.

Problems of Forensic Sciences 2017, vol. 109, 27–42 34 M. Michałek

5. Software for analysing AMR files 5) calculation of the number of audio data and exact duration of recording on the basis of read parame- Based on the above described results of analysis of ters, AMR file structure, our own algorithms and software 6) verification of file integrity and detection ofpos- were developed for automatic analysis of these types sible disorders of structure or detection of frames of audio files. This software was constructed and im- with other parameters, plemented in a MATLAB computational environment. 7) detailed report on the analysis of the file. It is presented in the form of a block diagram in Fig. 6. A significant element of the described software is The general principle of operation of the algorithm the presentation of a report containing results of the and software for automatic analysis of AMR files is as automatic file analysis. This report contains detailed follows: information about the parameters of the file and the 1) import of all the data saved in the audio file, recorded sound, the exact duration of the recording, 2) detection of file header and recognition of AMR the results of analysis of consistency of structure and type, the number of correct and any incorrect frames in the 3) detection of headers of successive frames with cod- AMR file. ed sound, and determination of its parameters using Fig. 7 shows a sample report generated on the ba- the built-in database, sis of analysis of a consistent file namedNagr002.amr 4) analysis of file structure frame after frame and com- recorded with a Nokia 3100c mobile phone. parison of parameters of all frames with each other Fig. 8 shows the results of analysis of an AMR file on the basis of information read from headers, recorded using a Nokia E52-1 phone, in which data structure disturbances occur.

Fig. 5. Disturbances in the structure of an AMR file recorded by a Nokia E52-1 mobile phone.

File import

Database of AMR File header detection AMR type file headers andanalysis (NB, WB)

Database of AMR Frame detection and File and sound frameheaders analysis parameters

Data integrity Anomaliesdetection

Analyse report

Fig. 6. A block scheme of the software constructed for automatic analysis of data structure of AMR audio files.

Problems of Forensic Sciences 2017, vol. 109, 27–42 Properties of recordings and audio files saved in amr format and an assessment of the possibility of applying them in... 35

Conclusions for analysis of multimedia files only provide basic and often imprecise information about files saved in Performing research on the properties of audio AMR format. Based on results of performed analyses recorded in AMR format enabled us to acquire and of AMR file structures, our own software was devel- systematize knowledge on these types of recordings oped and implemented for automatic analysis of these and files, and assess whether such a format is suitable types of files working in the MATLAB computation- for authentication investigations. It turned out that re- al environment. This software determines the correct cording in the seemingly uncomplicated AMR format parameters and analyses the integrity of files, as well enabled authentication examinations; the results of the as detecting any possible structural disturbances. The performed research indicated that for such recordings, collected and analysed test recordings, together with it is possible to apply generally recognised methods of the developed software for automatic analysis of AMR authentication analysis, such as – primarily – analysis files constitute useful tools for authentication exami- of the power line hum signal and file data structure. nations of evidential recordings, which are carried out Auxiliary methods may include analysis of charac- as part of expert witnessing at the Section of Speech teristics of the recording and auditory analysis. The and Audio Analysis at the Institute of Forensic Re- Windows operating system and popular programmes search.

Fig. 7. Detailed report of the analysis of a consistent AMR audio file recorded us- ing a Nokia 3100c mobile phone.

Fig. 8. Detailed report of the analysis of an inconsistent AMR audio file recorded us- ing a Nokia E52-1 mobile phone.

Problems of Forensic Sciences 2017, vol. 109, 27–42 36 M. Michałek

References 12. Kajstura, M., Trawińska, A., Hebenstreit, J. (2005). Ap- plication of the electrical network frequency (ENF) cri- 1. 3rd Generation Partnership Project (3GPP). Techni- terion; A case of a digital recording. Forensic Science cal Specification Group Services and System Aspects. International, 155, 165–171. (2010). Technical Specification 26.244 V9.2.0: Transpar- 13. Koenig, B. E. (1990). Authentication of forensic audio ent end-to-end packet switched streaming service (PSS). recordings. Journal of the Audio Engineering Society, http://www.3gpp.org (access 05.07.2017). 38(1/2), 3–33. 2. 3rd Generation Partnership Project (3GPP). Technical 14. Luo, D., Yang, R., Huang, J. (2015). Identification of Specification Group Services and System Aspects (2011). AMR decompressed audio. Digital Signal Processing, Technical Specification 3GPP TS 26.071 V10.0.0: Man- 37, 85–91. datory speech CODEC speech processing functions; 15. Michałek, M. (2009). The application of powerline hum AMR speech CODEC; General description. http://ww- in digital recording authenticity analysis. Problems of w.3gpp.org (accessed 05.07.2017). Forensic Sciences, 80, 355–364. 3. 3rd Generation Partnership Project (3GPP). Technical 16. Michałek, M. (2016). Test audio recordings and their use Specification Group Services and System Aspects. (2011). in authenticity examinations; Database of properties of Technical Specification 3GPP TS 26.090 V10.1.0: Man- digital audio recorders and recordings. Problems of Fo- datory Speech Codec speech processing functions; Adap- rensic Sciences, 105, 355–369. tive Multi-Rate (AMR) speech codec; Transcoding func- 17. Sjoberg, J., Westerlund, M., Lakaniemi, A., Xie, Q. tions. http://www.3gpp.org (accessed 05.07.2017). (2007). Request for Comments 4867: RTP Payload For- 4. Bhatt, N. S., Kosta, Y. P. (2011). Architectural study, im- mat and File Storage Format for the Adaptive Multi-Rate plementation and objective evaluation of code excited (AMR) and Adaptive Multi-Rate Wideband (AMR-WB) linear prediction based GSM AMR 06.90 speech coder Audio Codecs. Network Working Group, The IETF using MATLAB. International Journal of Advanced En- Trust, www.ietf.org (accessed 11.07.2017). gineering Technology, 2(2), 52–59. 5. Błasikiewicz, S., Miściuk, A., Wójcik, W. (1967). Pod- stawowy zakres badań fonoskopijnych prowadzonych w Zakładzie Kryminalistyki KG MO. Problemy Krymi- nalistyki, 67/68, 303–327. 6. European Telecommunications Standards Institute (ETSI). (2002). Technical Specification ETSI TS 126 071 V5.0.0: Universal Mobile Telecommunications Sys- tem (UMTS); AMR speech Codec; General description. http://www.etsi.org (accessed 01.07.2017). 7. Gloe, T., Fischer, A., Kirchner, M. (2014). Forensic analysis of video file formats. Digital Investigation, 11, 68–76. 8. Grigoras, C. (2005). Digital audio recording analysis: The electric network frequency (ENF) criterion. Inter- national Journal of Speech, Language and the Law, 12, 64–76. 9. Grigoras, C., Cooper, A., Michałek, M. (2009). Foren- sic Speech and Audio Analysis Working Group – Best practice guidelines for ENF analysis in forensic authen- tication of digital evidence; REF. CODE: FSAAWG- BPM-ENF-001, ENFSI Forensic Speech and Analysing Working Group, www.enfsi.eu (accessed 05.07.2017). 10. Hong, G., Yin, Z. (2013). Research on digital audio au- thenticity analysis. (In) Proceedings of the 2nd Interna- tional Conference on Computer Science and Electronics Engineering (ICCSEE 2013). Atlantis Press. Corresponding author 11. Kajstura, M., Michałek, M., Trawińska, A. (2017). Eks- Dr inż. Marcin Michałek pertyza fonoskopijna. (In) M. Kała, D. Wilk, J. Wójcikie- Section of Speech and Audio Analysis wicz (Eds.), Ekspertyza Sądowa. Zagadnienia wybrane, Institute of Forensic Research (674–726). Warszawa: Wolters Kluwer. ul. Westerplatte 9 PL 31-033 Kraków e-mail: [email protected]

Problems of Forensic Sciences 2017, vol. 109, 27–42 Problems of Forensic Sciences 2017, vol. 109, 27–42

WłAśCiWośCi nAgRAń i pliKóW dźWięKoWyCh zApiSAnyCh W foRMACie AMR oRAz oCenA MożliWośCi iCh zAStoSoWAniA W bAdAniACh AutentyCznośCi

1. Wstęp z funkcją dyktafonu oraz zapisanych w tzw. skrzynkach głosowych operatorów sieci komórkowych. Kodek Adaptive Multi-Rate (AMR) został ustandary- Aktualnie badania autentyczności nagrań cyfrowych zowany przez European Telecommunications Standards wymagają konkatenacji wyników i wniosków uzyska- Institute (ETSI) i jest rozwijany od 1999 roku przez 3rd nych z różnych fonoskopijnych metod badawczych, Generation Partnership Project (3GPP). Występuje on często przy współudziale metod z zakresu informatyki w dwóch odmianach, tj. wąskopasmowy AMR (Nar- sądowej (Kajstura, Michałek, Trawińska, 2017). Wyniki rowband), określany również jako AMR-NB, oraz szero- wykonanych prac wskazują, że rejestracja nagrań w sto- kopasmowy AMR-WB (Wideband, 3GPP, 2011a; ETSI, sunkowo nieskomplikowanym formacie AMR pozwala 2002). AMR i AMR-WB były pierwotnie przeznaczone na wykorzystanie uznanych i stosowanych metod do we- do zastosowania w systemach komunikacji radiowej. ryfikacji autentyczności, takich jak analiza przydźwięku Z uwagi na elastyczność tego kodeka i możliwość jego sieciowego oraz właściwości i struktury pliku (Hong, adaptacji do różnych jakości połączeń komunikacyjnych Yin, 2013; Grigoras, 2005; Kajstura i in., 2017). znalazł on także zastosowanie w mobilnej telefonii ko- Badania opisane w niniejszym artykule wykonano mórkowej GSM i UMTS (3GPP, 2011b; Sjoberg, We- w ramach projektu badawczego zrealizowanego w In- sterlund, Lakaniemi, Xie, 2007). Oprócz zastosowania stytucie Ekspertyz Sądowych im. Prof. dra Jana Sehna w systemach komunikacji mobilnej AMR jest wykorzy- w Krakowie. stywany także do przesyłania mowy w audio- i wideo- konferencjach oraz w łączności satelitarnej i VoIP. Za- pewnia on akceptowalną jakość sygnału mowy nawet dla 2. Kodowanie dźwięku w plikach formatu AMR słabych parametrów połączenia (Bhatt, Kosta, 2011; Sjo- berg i in., 2007). Format ten znajduje także zastosowanie Pliki formatu AMR nie zawierają zakodowanego do odtwarzania mowy w audiobookach oraz w komuni- dźwięku próbka po próbce, ale w postaci współczynni- katach głosowych. ków opisujących kolejne fragmenty nagrania. Kodek ten AMR to także format zapisu nagrań dźwiękowych, wykorzystuje algorytm liniowej predykcji zwany Alge- który wykorzystuje wymieniony wyżej kodek w wer- braic Codebook Excitation Linear Prediction (ACELP), sji wąskopasmowej (3GPP, 2011a; Sjoberg i in., 2007). który jest modyfikacją popularnego algorytmu liniowe- Nagrania dźwiękowe w tym formacie rejestrowane są go kodowania predykcyjnego Linear Predictive Coding głównie za pomocą telefonów komórkowych, ale także (LPC) stosowanego do kodowania i opisu sygnału mowy przez inne popularne urządzenia mobilne, na przykład ta- (3GPP, 2011b; Luo i in., 2015). blety (Luo, Yang, Huang, 2015; Michałek, 2016). AMR Przed właściwym procesem kodowania dźwięku za umożliwia zapis nagrań do plików dźwiękowych o róż- pomocą AMR następuje jego wstępne przygotowanie, nej jakości z wykorzystaniem przepływności od 4,75 które składa się z konwersji analogowego sygnału do do 12,2 kb/s (3GPP, 2011a). Format ten może być także postaci cyfrowej o parametrach: rozdzielczość 13 bitów, stosowany do utrwalania dźwięku wewnątrz struktury częstotliwość próbkowania 8000 Hz i kodowanie Pulse tak zwanych kontenerów multimedialnych, w których Code Modulation (PCM). Sygnał poddawany jest także zapisywane są nagrania wideo lub dźwiękowe. Przykła- filtracji górno-przepustowej z częstotliwością odcięcia dem są pliki w formacie 3GP i MP4, bardzo popularne wynoszącą 80 Hz (3GPP, 2011b). w nowoczesnych urządzeniach mobilnych, a szczególnie Kodek AMR działa w ten sposób, że dokonuje podzia- w telefonach komórkowych (3GPP, 2010; Gloe, Fischer, łu całego zapisywanego nagrania na krótsze fragmenty, Kirchner, 2014). tzw. ramki, o czasie trwania 20 ms. Dla częstotliwości W niniejszej pracy skoncentrowano się na właści- próbkowania 8000 Hz pojedyncza ramka zawiera 160 wościach nagrań i plików dźwiękowych utrwalanych próbek. W każdej ramce analizowany jest sygnał mowy w wąskopasmowym formacie AMR oraz możliwości ich i wyznaczane są parametry modelu ACELP: współ- wykorzystania w analizie autentyczności nagrań. Bada- czynniki LPC, adaptacyjne i stałe książki kodowe oraz nia wykonano z wykorzystaniem nagrań dźwiękowych wzmocnienia. Aby odtworzyć treść zapisanego nagrania, zarejestrowanych za pomocą telefonów komórkowych dekoder na podstawie parametrów modelu ACELP wy- 38 M. Michałek konuje proces syntezy zakodowanego sygnału (3GPP, W kolejnym etapie pojedyncza ramka zawierająca 2011a; ETSI, 2002). 160 próbek zostaje podzielona na cztery równe części, W dalszej części przedstawiono pokrótce zasadę dzia- tzw. podramki (subframes), po 40 próbek każda i trwa- łania kodera AMR na podstawie (3GPP, 2011a i 2011b; jące po 5 ms. W zależności od przepływności bitowej ETSI, 2002; Sjoberg i in., 2007). Proces zapisu dźwię- kodeka AMR wykorzystuje się skwantyzowane i nie- ku w pliku z wykorzystaniem kodeka AMR można po- skwantyzowane współczynniki LPC oraz interpolo- dzielić na kilka głównych etapów. W pierwszym z nich wane współczynniki LSP w różnych podramkach. Na wykonywana jest analiza krótkookresowa i obliczane są podstawie podramek wyznaczane są parametry książek współczynniki liniowej predykcji LPC 10. rzędu za po- kodowych Adaptive Codebook oraz Fixed Codebo- mocą algorytmu Levinsona-Durbina zgodnie ze wzorem: ok. Adaptive Codebook jest wyznaczana na podstawie 1 analizy długookresowej i zawiera wektory pobudzeń Hz()= m (1) o zmiennych wartościach w celu dostosowywania do -i parametrów sygnału mowy dla każdej podramki. Nato- 1+ ˆi za å miast Fixed Codebook zawiera wektory pobudzeń o sta- i=1 łych wartościach. W końcowym etapie kodowania AMR aˆ gdzie: i to współczynniki predykcji liniowej, a m=10 to wykorzystuje się techniki wyznaczania pobudzeń i ich rząd predykcji. wzmocnień oraz interwałów między pobudzeniami dla Zależność (1) umożliwia krótkookresową analizę sy- analizowanych ramek (Open-loop Pitch Search i Clo- gnału, w której modelowany jest trakt wokalny. W etapie sed-loop Pitch Analysis) w celu wyznaczenia najbardziej tym wykonywana jest także analiza długookresowa i ob- optymalnych parametrów kodowanego sygnału mowy. liczane są parametry funkcji pobudzenia traktu wokalne- Zapis nagrania do pliku odbywa się w taki sposób, go w celu późniejszej syntezy sygnału mowy za pomocą że dla każdej ramki o czasie trwania 20 ms koder gene- zależności: 11 ruje 95, 103, 118, 134, 148, 159, 204 albo 244 bity dla = przepływności 4,75; 5,15; 5,9; 6,7; 7,4; 7,95; 10,2 albo -T (2) B()z 1- p zg 12,2 kb/s. Po zakodowaniu pojedynczej ramki pamięć kodera jest aktualizowana w celu obliczenia parametrów gdzie: T to okres pobudzenia, a g to jego wzmocnienie. dla następnej ramki. Struktura każdego pliku AMR skła- Na podstawie analizy długookresowej tworzona jest da się z jego nagłówka, po którym znajduje się uporząd- tak zwana adaptacyjna książka kodowa (Adaptive Code- kowany zbiór ramek zawierający zakodowane kolejne book), którą dokładniej opisano poniżej. fragmenty nagrania (3GPP, 2011b; Sjoberg i in., 2007). W kolejnym etapie kodowania następuje transforma- cja obliczonych już współczynników LPC do postaci par LSP (Line Spectral Pair) na potrzeby dalszej kwantyza- 3. Materiał do badań i zastosowane metody cji. Transformacja ta wykonywana jest na podstawie de- F ' F ' kompozycji funkcji A(z) do wielomianów 1 i 2 według W celu wykonania zamierzonych badań zgromadzo- zależności: no i przeanalizowano możliwości rejestracji dwudziestu ' –11 –1 F1 ()z A()z += Az ()z pięciu telefonów komórkowych następujących marek i modeli: ' –11 –1 (3) i F2 ()z = A()z – Az ()z – BlackBerry: 8520 i 9320;

– HTC Wildfire; Następnie tak wyznaczone współczynniki LSP zo- – LG 9; stają poddane kwantyzacji w dziedzinie częstotliwości – MaxCom MM461BB; zgodnie z zależnością: – Nokia: 2700, 3100c, 6103, 6230, 6300, 6500c, C1-01, f C2-02, E50, E52-1, E65 i N95; f = s arccos()q i π2 i (4) – Samsung: Galaxy Ace III, GT-C3350 i Solid B2100; – Siemens C75; gdzie: i=1,...,10, fi to częstotliwości LSF (Line Spectral – Sony Ericsson: W595S i WT19i. Frequencies) w zakresie [0, 4000] Hz odpowiadające Za pomocą wymienionych wyżej urządzeń wykona- współczynnikom LSP, fs to częstotliwość próbkowania no 181 nagrań testowych zapisanych w formacie AMR. 8000 Hz, zaś qi to współczynniki LSP w domenie ko- Wykorzystano do tego celu funkcję dyktafonu oraz re- sinusowej. Następnie tak skwantyzowane współczynniki jestrację komunikatów w skrzynkach głosowych opera- zostają poddane liniowej interpolacji, po czym z powro- torów sieci komórkowych, które następnie zapisano do tem przetransformowane jako skwantyzowane współ- pamięci telefonów w plikach formatu AMR. Nagrania te czynniki LPC. wykonano z wykorzystaniem dostępnych funkcji pod- czas rejestracji, tj. uruchomienia i zakończenia nagry-

Problems of Forensic Sciences 2017, vol. 109, 27–42 Właściwości nagrań i plików dźwiękowych zapisanych w formacie AMR oraz ocena możliwości ich zastosowania w badaniach... 39 wania oraz funkcji pauzy. Zrealizowane one zostały odgłosów. Nie stwierdzono też żadnych charakterystycz- w różnych warunkach akustycznych, tj w zamkniętych nych śladów w strukturze plików AMR po zastosowaniu pomieszczeniach oraz na otwartej przestrzeni. Zawiera- funkcji pauzy. Zaobserwowano, że tzw. tło akustyczne ją zakres dźwięków oraz celowych zakłóceń o możliwie w nagraniu formatu AMR może odznaczać się nagłymi szerokim spektrum częstotliwościowym. Po utrwaleniu zmianami charakterystyk pomimo tego, że nagranie jest w pamięci telefonu każde z nagrań testowych zostało ciągłe i utrwalone w jednolitych warunkach akustycz- skopiowane na dysk twardy komputera laboratoryjnego nych, co zależne jest od zmiany amplitudy rejestrowa- lub wykonano obraz zawartości pamięci urządzenia. nych dźwięków. Format AMR zaprojektowany był głów- W celu dokonania oceny możliwości wykorzystania nie do przesyłania i rejestracji sygnału mowy, a dźwięk parametrów nagrań i plików utrwalonych w formacie w pliku zapisany jest jedynie w postaci współczynników AMR w badaniach autentyczności nagrania testowe pod- i odznacza się dość silną kompresją. W związku z po- dano następującym analizom: wyższym wnioski z badania integralności nagrania AMR – charakterystyk czasowych i częstotliwościowych za pomocą analizy audytywnej i jego charakterystyk po- z jednoczesną analizą audytywną; winny być zweryfikowane dodatkową metodą. – sygnału przydźwięku sieciowego – jako szczególny przypadek analizy charakterystyk nagrania; 4.2. Analiza sygnału przydźwięku sieciowego – właściwości plików odczytywanych za pomocą syste- mu operacyjnego Windows oraz narzędzi przeznaczo- Jedną z podstawowych metod badania autentyczno- nych do analizy plików multimedialnych; ści nagrań cyfrowych jest analiza sygnału przydźwięku – struktury danych zapisanych w plikach formatu AMR sieciowego, którego zmiany częstotliwości odpowiadają z wykorzystaniem programów do wizualizacji i edycji wahaniom częstotliwości prądu w sieci elektroenerge- w postaci kodu szesnastkowego i ASCII. tycznej (Grigoras, 2005). Jest to metoda powszechnie uznana i stosowana przez wiodące laboratoria fonosko- pijne; można stwierdzić, że jest ona szczególnym przy- 4. Wyniki padkiem analizy charakterystyk nagrania. Umożliwia przede wszystkim ustalenie ciągłości zapisu nagrania 4.1. Analiza charakterystyk i audytywna oraz daty i godziny jego rejestracji (Grigoras, Cooper, Michałek, 2009; Kajstura, Trawińska, Hebenstreit, Analiza charakterystyk czasowych i częstotliwościo- 2005; Michałek, 2009). Analiza charakterystyk nagrań wych połączona z analizą audytywną jest metodą badaw- testowych w formacie AMR wykazała, że w niektórych czą stosowaną głównie do oceny ciągłości nagrania (Bła- z nich możliwe było zarejestrowanie drugiej harmonicz- sikiewicz, Miściuk, Wójcik, 1967; Kajstura i in., 2017; nej sygnału przydźwięku sieciowego, tj. wokół często- Koenig, 1990). W celu analizy charakterystyk zarejestro- tliwości 100 Hz. Co ważne, amplituda i ciągłość tego wanych nagrań testowych przekonwertowano je z forma- sygnału pozwalała na jego ekstrakcję, obliczenie chwilo- tu AMR do nieskompresowanego formatu WAVE PCM wych wartości częstotliwości i porównanie z wartościa- za pomocą oprogramowania Adobe Audition. Ustalono, mi referencyjnymi. Drugą harmoniczną zarejestrowano że częstotliwość próbkowania wszystkich nagrań AMR w nagraniach z różnymi przepływnościami bitowymi wynosi 8000 Hz, a pasmo częstotliwościowe utrwalonych i odnotowano ją w nagraniach wykonanych telefonami dźwięków zawiera się w granicach, w przybliżeniu, 200– Nokia, Sony Ericsson oraz Samsung. W żadnym z nagrań 3400 Hz. W żadnym z nagrań testowych nie stwierdzono testowych nie stwierdzono natomiast obecności sygnału występowania tzw. składowej stałej sygnału. Część wy- przydźwięku sieciowego o częstotliwości podstawowej, korzystanych do badań telefonów komórkowych umoż- tzn. wokół 50 Hz. liwiała wstrzymanie nagrywania za pomocą funkcji pau- Na rysunku 1 przedstawiono zarejestrowaną drugą zy, co powodowało brak ciągłości zapisu nagrania. Na harmoniczną sygnału przydźwięku sieciowego w na- podstawie analizy audytywnej i charakterystyk nagrań graniu AMR zarejestrowanym telefonem Sony Ericsson AMR ustalono, że ujawnienie braku ciągłości możliwe W595S z przepływnością 12,2 kb/s. jest w obrębie sygnału mowy lub innych sygnałów o zna- W ramach prac wykonano także analizę wpływu nych parametrach. Jest to jednak zależne od parametrów przepływności bitowej kodeka AMR na wartość amplitu- wymienionych sygnałów, zwłaszcza stosunku ich ampli- dy drugiej harmonicznej sygnału przydźwięku sieciowe- tudy do zakłóceń. W nagraniach wykonanych za pomocą go. Amplituda przydźwięku to jeden z najważniejszych starszych modeli telefonów zastosowanie pauzy powo- parametrów tego sygnału (Grigoras, 2005; Kajstura i in., dowało często rejestrację charakterystycznych odgłosów 2005; Michałek, 2009). W tym celu nagranie testowe związanych z użyciem przycisków funkcyjnych. Wyko- w nieskompresowanym formacie, zawierające harmo- rzystanie w nowszych telefonach ekranów dotykowych niczną przydźwięku wokół częstotliwości 100 Hz, prze- uniemożliwia lub znacznie ogranicza rejestrację takich konwertowano za pomocą popularnego kodeka ffmpeg

Problems of Forensic Sciences 2017, vol. 109, 27–42 40 M. Michałek do nagrań w formacie AMR z wykorzystaniem możli- Program GSpot nie rozpoznaje plików zapisanych wych przepływności. Największą wartość amplitudy w formacie AMR i nie podaje o nich żadnych szczegó- drugiej harmonicznej uzyskano dla nagrania zakodowa- łowych informacji. Programy MediaInfo oraz ffprobe nego z przepływnością 12,2 kb/s, przy czym zauważono rozpoznają format AMR i prezentują poprawnie nastę- jej spadek o –4 dB w stosunku do amplitudy harmonicz- pujące informacje: format pliku (Adaptive Multi-Rate nej z nagrania nieskompresowanego. Dla przepływności: Narrowband), rozmiar, liczbę kanałów (1), częstotli- 10,2; 7,95; 7,4; 6,7; 5,9; 5,15 i 4,75 kb/s zanotowano wość próbkowania (8000 Hz) oraz rozdzielczość bito- dalsze spadki amplitudy tego sygnału wynoszące odpo- wą (13 bitów). Oba programy, tj. MediaInfo i ffprobe, wiednio –4,35; –4,65; –6,75; –7,7; –8,9; –9,8 i –10 dB podają dodatkowo nieprecyzyjnie: czas trwania nagrania w odniesieniu do nagrania nieskompresowanego. Wy- oraz wartość przepływności bitowej w kb/s. W tabeli 1 nika z tego, że zastosowanie mniejszej przepływności przedstawiono porównanie rzeczywistych wartości prze- bitowej podczas kodowania AMR, czyli silniejszej kom- pływności bitowej testowych plików AMR z zakresu od presji, powoduje redukuję wartości amplitudy drugiej 4,75 do 12,2 kb/s z wartościami odczytanymi za pomocą harmonicznej sygnału przydźwięku sieciowego. Usta- wymienionych programów. lono, że zmiana tej amplitudy nie miała wpływu na po- prawność weryfikacji czasu rejestracji przygotowanych 4.4. Analiza struktury danych w plikach formatu nagrań względem bazy referencyjnej, pod warunkiem AMR jednak akceptowalnego stosunku amplitudy sygnału do zakłóceń (Michałek, 2009). Jedną z metod stosowanych podczas badań auten- tyczności nagrań multimedialnych jest analiza struktury 4.3. Analiza właściwości plików dźwiękowych danych w plikach z zapisem tych nagrań. Analizę taką AMR przeprowadza się z wykorzystaniem oprogramowań umożliwiających wizualizację i edycję plików w tak Na podstawie wykonanych nagrań testowych w for- zwanym kodzie szesnastkowym. Pliki multimedialne macie AMR ustalono, że każde z nich zapisane zostało mają w swojej strukturze metadane, które opisują właści- do pliku z rozszerzeniem *.amr. we dane z zakodowanym nagraniem. Metadane mogą za- Podstawową metodą analizy plików, w tym także wierać istotne informacje o pliku, przykładowo: format dźwiękowych, jest odczytanie informacji prezentowa- zapisu i jego parametry, algorytm kodowania, sygnatury nych przez system operacyjny komputera. Są to przede czasowe lub nazwę urządzenia rejestrującego. Analiza wszystkim: typ pliku, sygnatury czasowe utworzenia, struktury pliku umożliwia również ujawnienie ewentu- modyfikacji i ostatniego dostępu oraz jego rozmiar. Dla alnego zaburzenia jego integralności oraz wpisów wska- rozpoznawanych formatów system operacyjny podaje zujących na edycję pliku za pomocą oprogramowania również parametry zapisu pliku dźwiękowego, takie jak: (Hong, Yin, 2013; Kajstura i in., 2017). format, algorytm kodowania, przepływność, częstotli- Analiza struktury plików z nagraniami testowymi wość próbkowania i rozdzielczość kwantowania (Hong, w formacie AMR wykazała, że każdy z nich składa się Yin, 2013; Kajstura i in., 2017; Michałek, 2016). Do od- z nagłówka pliku o rozmiarze 6 bajtów, który zapisany czytu szczegółowych informacji pliku dźwiękowego słu- jest jako 23 21 41 4D 52 0A w kodzie szesnastkowym, co żą również dedykowane programy. odpowiada #!AMR\n w kodzie ASCII. Nagłówek przy- Za pomocą opcji Właściwości pliku systemów ope- kładowego pliku AMR zaprezentowano na rysunku 2. racyjnych Windows: XP Professional, 7 Ultimate oraz Dla formatu AMR-WB nagłówek pliku ma postać 10 Professional odczytano informacje dotyczące plików 23 21 41 4D 52 2D 57 42 0A w kodzie szesnastkowym, dźwiękowych AMR zarejestrowanych w ramach niniej- co odpowiada #!AMR-WB\n w kodzie ASCII. szej pracy. Ustalono, że wszystkie wymienione systemy Bezpośrednio za nagłówkiem pliku znajduje się upo- operacyjne Windows dla plików w formacie AMR pre- rządkowana struktura ramek. Każda ramka w pojedyn- zentowały jedynie podstawowe informacje, takie jak: czym pliku zawiera zakodowany fragment nagrania ze nazwy plików, ich rozmiar, typ pliku AMR Narrow-Band stałą przepływnością bitową. Na początku każdej ramki Content oraz daty i godziny utworzenia, modyfikacji znajduje się jej nagłówek o rozmiarze 1 bajta, w którym i ostatniego dostępu. zapisane są informacje o trybie kodowania, przepływ- Do analizy właściwości plików zapisanych ności bitowej i ewentualnych błędach w danych ramki. w formacie AMR wykorzystano także kilka popu- Dźwięk w plikach formatu AMR kodowany jest w ośmiu larnych programów przeznaczonych do analizy pli- trybach (zwanych również modami) z przepływnościami ków multimedialnych, tj.: GSpot v. 2.70, MediaInfo bitowymi zależnymi od jakości nagrywania: 4,75; 5,15; v. 0.7.95 oraz ffprobe będący częścią pakietu ffmpeg 5,9; 6,7; 7,4; 7,95; 10,2 albo 12,2 kb/s. Każda ramka za- v. N-81664-g6f062eb. wiera fragment nagrania trwający 20 ms, jednak w zależ- ności od trybu AMR dla danego urządzenia liczba baj-

Problems of Forensic Sciences 2017, vol. 109, 27–42 Właściwości nagrań i plików dźwiękowych zapisanych w formacie AMR oraz ocena możliwości ich zastosowania w badaniach... 41 tów w każdej ramce oraz jej rozmiar są różne. W tabeli 2 urządzeniem, który obrazuje opisany wyżej problem. Na podano zestawienie informacji dotyczących możliwych niniejszym rysunku zaznaczono nagłówki ramek o war- trybów kodowania AMR, przepływności bitowej, roz- tości 3C oraz niepoprawną siódmą ramkę. Nie odnoto- miaru ramki w bajtach z zakodowanym dźwiękiem oraz wano tego typu zaburzeń struktury w plikach AMR zapi- nagłówka ramki w zapisie szesnastkowym. sanych przez pozostałe badane urządzenia. Na rysunku 3 przedstawiono fragment danych jed- Opisane wyżej samoistne zaburzenia struktury pliku nego z testowych plików AMR z zaznaczoną strukturą AMR nie oznaczają, że plik taki został poddany edycji pięciu pierwszych ramek. Jak można zauważyć, każda za pomocą oprogramowania komputerowego. Wskazują ramka zawiera nagłówek o wartości 14 w zapisie szes- natomiast na cechę charakterystyczną dla analizowanego nastkowym, co wskazuje, że jej rozmiar wynosi 16 baj- urządzenia. Dlatego tak istotnym elementem w trakcie tów, a dane charakteryzują się przepływnością 5,9 kb/s. badań autentyczności jest wykonanie nagrań testowych Analiza plików AMR z nagraniami testowymi zare- badanym rejestratorem i ich analiza porównawcza z na- jestrowanymi funkcją dyktafonu wykazała, że nagłówki graniami dowodowymi (Michałek, 2016). ramek przyjmowały wartości od 04 do 3C. W tabeli 3 W wyniku analizy nagrań wykonanych na potrzeby zaprezentowano odczytane parametry plików dźwię- niniejszej pracy nie stwierdzono, aby zastosowanie funk- kowych utrwalonych za pomocą funkcji dyktafonu dla cji pauzy w trakcie rejestracji powodowało zaburzenia przeanalizowanych telefonów komórkowych. struktury danych w plikach AMR. Ustalono, że wszystkie nagrania pochodzące ze skrzynek głosowych operatora sieci komórkowej PLAY, które zapisano w plikach formatu AMR, odznaczają się 5. oprogramowanie do analizy plików AMR nagłówkiem ramek o wartości 2C i przepływnością bito- wą 7,95 kb/s. W tabeli 4 przedstawiono parametry wy- Na podstawie opisanych wyżej wyników badań mienionych plików z uwzględnieniem telefonów komór- struktury plików w formacie AMR opracowano własne kowych, w pamięci których zostały one zapisane. algorytmy i program komputerowy do automatycznej Jak wspomniano, w strukturze plików AMR znajdu- analizy tego typu plików dźwiękowych. Program ten ją się informacje dotyczące: formatu pliku, trybu kodo- skonstruowano i zaimplementowano w środowisku obli- wania, przepływności bitowej i ewentualnych błędów czeniowym MATLAB. Jego schemat blokowy przedsta- w ramkach. Analiza tej struktury nie wykazała natomiast wiono na rysunku 6. obecności danych związanych z marką i modelem urzą- Ogólna zasada działania algorytmu i oprogramowa- dzenia, datą i godziną rejestracji nagrania oraz rozmia- nia do automatycznej analizy plików w formacie AMR rem pliku. jest następująca: Ponieważ w pojedynczym pliku AMR każda ramka 1) import wszystkich danych zapisanych w pliku dźwię- ma taki sam nagłówek oraz długość, tworzą one upo- kowym, rządkowaną strukturę danych. Na tej podstawie można 2) detekcja nagłówka pliku i rozpoznanie typu AMR, wykonywać analizę pliku AMR w celu oceny jego spój- 3) detekcja nagłówków kolejnych ramek z zakodowa- ności oraz detekcji ewentualnych zaburzeń lub edycji. nym dźwiękiem i określenie jego parametrów z wyko- Na rysunku 3 przedstawiono fragment danych jednego rzystaniem wbudowanej bazy danych, z testowych plików AMR mającego spójną strukturę. Na 4) na podstawie odczytanych informacji z nagłówków rysunku 4 zaprezentowano początkowy fragment tego analiza struktury pliku ramka po ramce oraz porówna- samego pliku, przy czym licząc od drugiej ramki usu- nie ze sobą parametrów wszystkich ramek, nięto z niego część danych odpowiadającą około 0,2 se- 5) obliczenie liczby danych dźwiękowych i dokładnego kundy nagrania. Na rysunku zaznaczono drugą ramkę, czasu trwania nagrania na podstawie odczytanych pa- z której usunięto dane dźwiękowe, jak również nagłówki rametrów, ramek w tak przetworzonym pliku. Jak można zauważyć, 6) weryfikacja integralności pliku oraz detekcja ewentu- w wyniku tej edycji struktura pliku uległa zaburzeniu. alnych zaburzeń struktury lub ramek o innych para- Na podstawie analizy struktury nagrań testowych metrach, ustalono, że w plikach AMR zarejestrowanych za pomo- 7) szczegółowy raport z wykonanej analizy pliku. cą telefonu Nokia E52-1 znajdują się zaburzenia struktu- Istotnym elementem opisywanego oprogramowania ry danych w prawidłowo wykonanych i ciągłych nagra- jest przedstawienie raportu zawierającego wyniki auto- niach. Zauważono, że długość niektórych ramek z zako- matycznej analizy pliku. Raport ten zawiera szczegółowe dowanym dźwiękiem nie odpowiada długości wskazanej informacje o parametrach pliku i zapisanego dźwięku, w ich nagłówkach. Miejsca występowania tych zaburzeń dokładnym czasie trwania nagrania, wynikach analizy były różne w kolejnych plikach wykonanych tym samym spójności struktury i liczbie poprawnych oraz ewentual- telefonem komórkowym. Na rysunku 5 przedstawiono nych niepoprawnych ramek w pliku AMR. początkowy fragment pliku AMR zarejestrowanego tym

Problems of Forensic Sciences 2017, vol. 109, 27–42 42 M. Michałek

Na rysunku 7 przedstawiono przykładowy raport wy- generowany na podstawie analizy spójnego pliku o na- zwie Nagr002.amr zarejestrowanego telefonem komór- kowym Nokia 3100c. Na rysunku 8 zaprezentowano wynik analizy pliku AMR wykonanego telefonem Nokia E52-1, w którym występują zaburzenia struktury danych.

Wnioski

Wykonanie badań nad właściwościami dźwięku za- pisanego w formacie AMR pozwoliło pozyskać i usys- tematyzować wiedzę o tego typu nagraniach i plikach oraz ocenić możliwości analizy ich autentyczności. Za- pis nagrania w pozornie nieskomplikowanym formacie AMR umożliwia wykonanie badań mających na celu ocenę autentyczności takiego nagrania. Wyniki przepro- wadzonych prac wykazały, że dla nagrań utrwalonych w tym formacie możliwe jest zastosowanie powszechnie uznanych metod badania autentyczności, przede wszyst- kim takich, jak analiza sygnału przydźwięku sieciowego oraz struktury danych w pliku. Metodami wspomagają- cymi mogą być analiza charakterystyk nagrania i audy- tywna. Wykorzystanie systemu operacyjnego Windows i popularnych programów do analizy plików multime- dialnych dostarcza jedynie podstawowych i często nie- precyzyjnych informacji o plikach zapisanych w forma- cie AMR. Na podstawie wyników z przeprowadzonych analiz struktur plików AMR zaprojektowano i wykonano własne oprogramowanie do automatycznej analizy tego typu plików pracujące w środowisku obliczeniowym MATLAB. Oprogramowanie to wyznacza poprawne pa- rametry oraz wykonuje analizę integralności pliku i de- tekcję ewentualnych zaburzeń struktury. Zgromadzone i przeanalizowane nagrania testowe oraz wykonane opro- gramowanie do automatycznej analizy plików AMR sta- nowią użyteczne narzędzia podczas badań autentycznoś- ci nagrań dowodowych, jakie wykonuje się w związku z działalnością opiniodawczą w Pracowni Analizy Mowy i Nagrań Instytutu Ekspertyz Sądowych.

Problems of Forensic Sciences 2017, vol. 109, 27–42