이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
whats wrong in the following?
조회 수: 3 (최근 30일)
이전 댓글 표시
[y, Fs] = audioread('Track48.wav');
y1 = y(:,1); y2 = y(:,2);
Y = [y1 y2];
wavwrite(Y ,Fs, 'newfile.wav');
% %audiowrite('newfile.wav', Y ,Fs);
........................................................................................
Error on running:
Error using wavwrite>OpenWaveWrite (line 170)
Unable to open file. Reason: Permission denied
Error in wavwrite (line 96)
fid = OpenWaveWrite(wavefile);
Error in Test2 (line 16)
wavwrite(Y ,Fs, 'newfile.wav');
Thanks a lot
답변 (1개)
madhan ravi
2019년 1월 10일
편집: madhan ravi
2019년 1월 10일
Try changing the working directory or run as administrator it is clear from the message that file permission is denied.
댓글 수: 21
VINAYAK KARANDIKAR
2019년 1월 10일
The working directory is the same as the one in which the MATLAB file is located. Everything is alright there. The problem is with the code, i think!!!
VINAYAK KARANDIKAR
2019년 1월 10일
No, i restarted the computer and now i get better results while testing the larger code, of which i had sent only a snippet. Nevertheless, i think there is a problem with the audio files itself. If i send them here, can someone tell me if they know how to hear them? Maybee someone can give me their email address, the files are too large to even compress them?
Thanks
Walter Roberson
2019년 1월 10일
no that error can only ever mean that you are not authorised to create the file at that location or that you are not authorised to overwrite an existing file at that location . It can never mean there is a problem in the content of the file .
If the code works for a bit but then fails then one possibility is that you or the code changed to a different directory .
VINAYAK KARANDIKAR
2019년 1월 10일
But man, that error no longer appears. Only i cannot hear anything when i play the audio now.
Walter Roberson
2019년 1월 10일
which release are you using and which operating system ? You should probably be switching to audiowrite()
VINAYAK KARANDIKAR
2019년 1월 10일
@Walter Roberson: I use 2013b MATLAB on Windows 10. I have used audio write function as well. Its commented in my code above, as you can see. I was expermenting with various permutations and combinations. Thanks
Walter Roberson
2019년 1월 10일
Try
[y, Fs] = audioread('Track48.wav');
audiowrite('newfile.wav', y, Fs);
and see if there is any difference in what you hear between the two using an external player.
VINAYAK KARANDIKAR
2019년 1월 10일
Hey, this works fine with 'track48.wav' but not with 'SDRSharp_20171103_160212Z_97990kHz_IQ.wav'
I think there is something wrong with the latter audio wav file only.
VINAYAK KARANDIKAR
2019년 1월 10일
Hey here is the link: https://drive.google.com/open?id=1z71VFMaRHrsIuQVBLmiqq_aLBhewrJZS
Let me know what you have been able to find out and do?
Walter Roberson
2019년 1월 12일
That file has a sample frequency of 900001 which is beyond the capabilities of my hardware to play.
VINAYAK KARANDIKAR
2019년 1월 12일
Exactly. Something is wrong with this file. I will get back to my file provider about this. Thanks a lot. I think we can close this discussion here?
Walter Roberson
2019년 1월 13일
Based on the file name, it looks like it might be from a scientific instrument that was sampling at 97990kHz (nearly 1 GHz), and that it is possibly in quadrature mode. I am not currently convinced that it is intended to be "sound" in the human range.
... Though if it is quadrature encoded, it does not appear to have constellations.
If you use the 'native' mode for audioread(), and look at min() and max() of the data, it looks like it does not span the full range like human sound would be likely to. It looks like it is close to symmetric around 0 with a full span that just might be 2^14*3/2 or possibly 24000 .
Ah, look at that. Filename is SDRSharp_20170415_070322Z_97990kHz_IQ.wav and SDRSharp is the name of a Software Defined Radio program. You are not dealing with audio.
VINAYAK KARANDIKAR
2019년 1월 13일
If i am not dealing with audio, then what is the nature of the signal according to you?
And how do i use MATLAB to process it?
Basically i am supposed to implement a Digital FM Stereo Receiver in MATLAB to process this signal(the wav file i sent here)
Thanks
Walter Roberson
2019년 1월 13일
The file is samples of radio frequency transmissions. Storing it in a .wav was convenient to the people who created it, but that does not mean that it was audio in the human sense. It is just data recordings.
The data was recorded with the program SDR# (SDRSharp)
audioinfo() reports that it is 16 bits per sample, and examining the data I see differences in value at the int16 level as small as 1, but the top bit does not seem to be used. This suggests that it really is 16 bits, rather than 12 bits stuffed into 16. However, if you look at histogram in more detail, it looks likely that the samples are in bins of width 2^8 (256) at the int16 level, as if there were roughly 91 frequency bins that are 256 apart and that for whatever reason, values are distributed around those centers instead of being exactly those centers (perhaps for phase reasons, perhaps for signal edge transition reasons, perhaps for noise reasons.) But if you
[data,fs] = audioread('SDRSharp_20170415_070322Z_97990kHz_IQ.wav', 'native');
N = 8; histogram(floor(data(:)/(2^N)),-2^(14-N):2^(14-N)-1)
then you do get a nice smooth bimodal distribution with the peaks near +/- 3072 (and distinctly non-trivial counts between.) This is not a binary encoding.
You mentioned FM: frequency modulation around centers 256 apart could plausibly account for the bin shapes.
The file name hints at 97.9 MHz, which is plausible for FM Channel 250 https://en.wikipedia.org/wiki/List_of_channel_numbers_assigned_to_FM_frequencies_in_North_America for non-digital FM radio, but the file name also hints at 97.99 MHz which could be "98.0 MHz" which could be from Europe or Africa (in North America, only odd frequencies are used.)
I am getting a bit lost following the technical description of how FM encodes stereo.
Atch, I just realized that in part I have been mentally confusing frequency vs amplitude. The histograms I am referring to above are about amplitude. You need to do a frequency analysis.
Walter Roberson
2019년 1월 13일
Introduced in R2014b
You can use hist() instead of histogram() for this purpose.
Next time please fill out the Product / Release fields in your question so that we do not give you answers that are not suitable for your old release.
![untitled.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200661/untitled.jpeg)
VINAYAK KARANDIKAR
2019년 1월 13일
Alright, thanks.
So basically my question is answered: Its not an audio file, i won't hear a human sound.
Next i have to design a FM receiver.
Does the material in the above link, particularly the decoder diagram suffice for this task(FM Receiver design in MATLAB), in your opinion?
Thanks
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)