You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							21 lines
						
					
					
						
							1009 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							21 lines
						
					
					
						
							1009 B
						
					
					
				| function SNR = demoAAC2(fNameIn, fNameOut) | |
| %Function that demonstrates usage of the level 2 code | |
| %   Usage SNR = demoAAC2(fNameIn, fNameOut), where: | |
| %       Inputs | |
| %       - fNameIn is the filename and path of the file to encode | |
| %       - fNameOut is the filename and path of the file that will be | |
| %       written after decoding | |
| % | |
| %       Output | |
| %       - SNR is the signal to noise ration computed after successively | |
| %       encoding and decoding the audio signal | |
| 
 | |
|     AACSeq2 = AACoder2(fNameIn); | |
|     decodedAudio = iAACoder2(AACSeq2, fNameOut); | |
| 
 | |
|     [audioData, ~] = audioread(fNameIn); | |
|          | |
|     snr(audioData(1025:length(decodedAudio)-1024, 1), audioData(1025:length(decodedAudio)-1024, 1) - decodedAudio(1025:end-1024, 1)) | |
|     snr(audioData(1025:length(decodedAudio)-1024, 2), audioData(1025:length(decodedAudio)-1024, 2) - decodedAudio(1025:end-1024, 2)) | |
|     SNR = snr(audioData(1025:length(decodedAudio)-1024, :), audioData(1025:length(decodedAudio)-1024, :) - decodedAudio(1025:end-1024, :)); | |
| end
 | |
| 
 |